/* ============================================================
   Testing Titbits — Design System
   ============================================================ */

:root {
  --bg:        #0d0f14;
  --bg2:       #12151d;
  --surface:   #1a1e2a;
  --surface2:  #222736;
  --border:    #2a2f3d;
  --text:      #e8eaf0;
  --muted:     #8b90a0;
  --dim:       #555b6e;

  --blue:      #3b82f6;
  --blue-dim:  #1e3a5f;
  --blue-glow: rgba(59,130,246,0.15);

  --purple:    #8b5cf6;
  --purple-dim:#3b1f6e;
  --purple-glow: rgba(139,92,246,0.15);

  --ok:        #10b981;
  --err:       #ef4444;
  --warn:      #f59e0b;

  --fh: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fm: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fh);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App shell ─────────────────────────────────────────── */
.tt-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────── */
.tt-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.tt-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tt-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.tt-logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  color: #fff;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.tt-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.tt-logo-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.tt-logo-tagline {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--fm);
  letter-spacing: 0.04em;
}

.tt-site-link {
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.2s;
}
.tt-site-link:hover { color: var(--text); text-decoration: none; }

/* ── Main ──────────────────────────────────────────────── */
.tt-main { flex: 1; }

/* ── Hero ──────────────────────────────────────────────── */
.tt-hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 2rem 4rem;
  text-align: center;
}

.tt-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, rgba(59,130,246,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(139,92,246,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.tt-hero-inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.tt-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.3rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--fm);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}

.tt-hero-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.tt-accent {
  background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tt-hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Games section ─────────────────────────────────────── */
.tt-games {
  padding: 2rem 2rem 5rem;
}

.tt-games-inner {
  max-width: 900px;
  margin: 0 auto;
}

.tt-section-label {
  font-size: 0.72rem;
  font-family: var(--fm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 1.5rem;
}

.tt-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* ── Game Card ─────────────────────────────────────────── */
.tt-game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.tt-game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  border-radius: inherit;
}

.tt-game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.tt-game-card:has(.tt-play-blue):hover {
  border-color: var(--blue);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--blue), inset 0 0 60px var(--blue-glow);
}

.tt-game-card:has(.tt-play-purple):hover {
  border-color: var(--purple);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--purple), inset 0 0 60px var(--purple-glow);
}

.tt-game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tt-game-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tt-game-icon svg {
  width: 24px;
  height: 24px;
}

.tt-icon-blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.tt-icon-purple {
  background: var(--purple-dim);
  color: var(--purple);
}

.tt-game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.tt-game-tag {
  font-size: 0.68rem;
  font-family: var(--fm);
  letter-spacing: 0.04em;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

.tt-game-card-body {
  flex: 1;
}

.tt-game-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.tt-game-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.tt-game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.tt-game-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--dim);
  font-family: var(--fm);
}

.tt-play-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
  font-family: var(--fh);
}

.tt-play-btn:hover { opacity: 0.88; transform: scale(1.03); }
.tt-play-btn:active { transform: scale(0.98); }

.tt-play-blue   { background: var(--blue);   color: #fff; }
.tt-play-purple { background: var(--purple); color: #fff; }

/* ── About ─────────────────────────────────────────────── */
.tt-about {
  padding: 0 2rem 5rem;
}

.tt-about-inner {
  max-width: 900px;
  margin: 0 auto;
}

.tt-about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.tt-about-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.tt-about-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 1.25rem;
}

.tt-about-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
}
.tt-about-link:hover { text-decoration: underline; }

/* ── Footer ────────────────────────────────────────────── */
.tt-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
}

.tt-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--dim);
}

.tt-footer-inner a { color: var(--muted); }
.tt-footer-inner a:hover { color: var(--text); text-decoration: none; }

.tt-footer-sep { color: var(--border); }

/* ── Blazor loading ────────────────────────────────────── */
#blazor-error-ui {
  color-scheme: dark;
  background: #1a1e2a;
  border-top: 1px solid var(--err);
  bottom: 0;
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  color: var(--text);
  font-size: 0.85rem;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.loading-progress {
  position: absolute;
  display: block;
  width: 6rem;
  height: 6rem;
  inset: 30vh 0 auto 0;
  margin: 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: var(--surface2);
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--blue);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  inset: calc(30vh + 4.5rem) 0 auto 0;
}

.loading-progress-text::after {
  content: var(--blazor-load-percentage-text, "Loading");
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .tt-header-inner { padding: 0 1.25rem; }
  .tt-hero { padding: 3.5rem 1.25rem 3rem; }
  .tt-games { padding: 1.5rem 1.25rem 4rem; }
  .tt-about { padding: 0 1.25rem 4rem; }
  .tt-game-grid { grid-template-columns: 1fr; }
  .tt-about-card { padding: 1.75rem; }
  .tt-footer { padding: 1rem 1.25rem; }
  .tt-site-link { display: none; }
}
