/* ===== TETRITYPE! — Global Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Open+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --c-bg:          #0d0f14;
  --c-bg-mid:      #12161e;
  --c-bg-light:    #f4f4f6;
  --c-surface:     rgba(18,22,32,0.85);
  --c-surface-2:   rgba(28,34,48,0.9);
  --c-blue:        #2a6cd3;
  --c-blue-bright: #4a8ef0;
  --c-pink:        #eb425f;
  --c-green:       #2e9e53;
  --c-orange:      #f5813d;
  --c-navy:        #1e3a5f;
  --c-purple:      #7c2c8a;
  --c-cyan:        #5ed8d8;
  --c-amber:       #f7d96a;
  --c-text:        #e8e8ec;
  --c-text-dim:    #9999aa;
  --c-text-dark:   #e8e8ec;
  --c-text-muted:  #666677;
  --c-border:      rgba(255,255,255,0.1);
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     18px;
  --radius-pill:   999px;
  --shadow-sm:     0 2px 10px rgba(0,0,0,0.4);
  --shadow-md:     0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.6);
  --font-body:     'Space Grotesk', 'Open Sans', system-ui, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }

/* ===== GLOBAL DARK BASE + ANIMATED DOT GRID ===== */
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}
/* Background canvas for animated environments (desert / galaxy) */
#bgCanvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity 1.0s ease; }

/* Animated dot grid — sits above #bgCanvas */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.30) 1.5px, transparent 1.5px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 1;
  animation: grid-pan 24s linear infinite;
}
body.round-1::before {
  background-image: radial-gradient(circle, rgba(255,255,240,0.18) 1.5px, transparent 1.5px);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(42,108,211,0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 85%, rgba(235,66,95,0.10) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}
@keyframes grid-pan {
  from { background-position: 0 0; }
  to   { background-position: 72px -72px; }
}

/* Round-specific body backgrounds (canvas handles the animated scenery) */
body.round-1 { background: #f0ece4; }
body.round-1::after { background: none; }
body.round-2 { background: #0d0f14; }
body.round-2::after {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(245,129,61,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(247,181,106,0.08) 0%, transparent 45%);
  animation: none;
}
body.round-3 { background: #03030c; }
body.round-3::after {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(60,20,80,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(20,40,100,0.2) 0%, transparent 50%);
  animation: none;
}
body.round-3 .starfield { display: none; }
/* Mode-specific body backgrounds (BgCanvas covers with animated scene) */
body.enterprise-active { background: #03061a; }
body.enterprise-active::after { background: radial-gradient(ellipse at 30% 20%, rgba(0,100,200,0.08) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(80,0,160,0.08) 0%, transparent 50%); animation: none; }
body.speed-active { background: #080a0c; }
body.speed-active::after { background: radial-gradient(ellipse at 50% 45%, rgba(255,70,0,0.07) 0%, transparent 60%); animation: none; }
body.combat-active { background: #0d0004; }
body.combat-active::after { background: radial-gradient(ellipse at 50% 70%, rgba(140,10,0,0.15) 0%, transparent 60%); animation: none; }
.starfield {
  display: none;
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px,   rgba(255,255,255,0.85), transparent),
    radial-gradient(2px 2px at 40px 70px,   rgba(255,255,255,0.65), transparent),
    radial-gradient(1px 1px at 90px 40px,   rgba(255,255,255,0.75), transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(200,220,255,0.8),  transparent),
    radial-gradient(1px 1px at 230px 80px,  rgba(255,255,255,0.55), transparent),
    radial-gradient(2px 2px at 300px 200px, rgba(255,240,200,0.75), transparent),
    radial-gradient(1px 1px at 350px 150px, rgba(255,255,255,0.85), transparent),
    radial-gradient(2px 2px at 450px 250px, rgba(200,200,255,0.65), transparent),
    radial-gradient(1px 1px at 500px 100px, rgba(255,255,255,0.75), transparent),
    radial-gradient(2px 2px at 600px 300px, rgba(255,220,180,0.8),  transparent),
    radial-gradient(1px 1px at 700px 180px, rgba(255,255,255,0.55), transparent),
    radial-gradient(2px 2px at 750px 350px, rgba(180,200,255,0.75), transparent),
    radial-gradient(1px 1px at 850px 220px, rgba(255,255,255,0.85), transparent),
    radial-gradient(2px 2px at 950px 400px, rgba(255,255,255,0.65), transparent),
    radial-gradient(1px 1px at 1050px 280px,rgba(220,220,255,0.75), transparent),
    radial-gradient(2px 2px at 1150px 450px,rgba(255,240,220,0.8),  transparent),
    radial-gradient(1px 1px at 1250px 320px,rgba(255,255,255,0.55), transparent),
    radial-gradient(2px 2px at 50px 400px,  rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 150px 550px, rgba(180,220,255,0.8),  transparent),
    radial-gradient(2px 2px at 400px 700px, rgba(255,240,200,0.75), transparent),
    radial-gradient(1px 1px at 700px 900px, rgba(200,200,255,0.65), transparent),
    radial-gradient(2px 2px at 1000px 850px,rgba(255,220,180,0.8),  transparent);
  background-size: 1400px 1000px;
  animation: starfield-drift 55s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes starfield-drift {
  from { transform: translateX(0) translateY(0); }
  to   { transform: translateX(-700px) translateY(-500px); }
}
@keyframes gradient-shift {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
@keyframes transcendent-flash {
  0%,100% { filter: brightness(1); }
  25%  { filter: brightness(2) saturate(1.5); }
  50%  { filter: brightness(1.5) hue-rotate(30deg); }
  75%  { filter: brightness(2) saturate(1.2); }
}
body.transcendent-flash { animation: transcendent-flash 2s ease; }

/* ===== SCREEN LAYER ===== */
.screen {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  display: none;
  z-index: 2;
  transition: opacity 0.35s ease;
}
.screen:not([hidden]) { display: block; }
.screen.fading-out { opacity: 0 !important; pointer-events: none; }
.screen.fading-in  { opacity: 1; }

/* Sign-in: fully transparent — inherits dark body */
#signinScreen { background: transparent; }
/* Menu & Profile: glass panel feel */
#menuScreen, #profileScreen { background: transparent; }
/* Play: background managed by round classes */
#playScreen { background: transparent; display: flex; flex-direction: column; }

/* ===== SHARED LAYOUT ===== */
.page {
  max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem;
  min-height: 100vh; display: flex; flex-direction: column;
  position: relative; z-index: 2;
}
/* Sign-in: vertically center the form in the viewport */
#signinScreen .page {
  justify-content: center; gap: 0.5rem; padding: 1.5rem;
}
/* Menu: vertically center columns */
#menuScreen .page {
  justify-content: center;
}
/* Profile: start from top as usual */
#profileScreen .page {
  justify-content: flex-start;
}

.brand-row { display: flex; justify-content: center; padding: 2rem 0 1rem; }
.brand-wordmark    { max-width: 300px; height: auto;
  filter: invert(1) drop-shadow(0 2px 12px rgba(74,142,240,0.3)); }
.brand-wordmark-sm { max-width: 150px; height: auto;
  filter: invert(1) brightness(0.9); }
.play-wordmark     { display: none; }

.divider { height: 3px; border-radius: 2px; margin: 0 auto 2rem; max-width: 160px; }
.divider-orange { background: var(--c-orange); }
.divider-blue   { background: var(--c-blue-bright); }
.divider-pink   { background: var(--c-pink); }

/* ===== SIGN-IN FORMS ===== */
.signin-stack {
  display: flex; flex-direction: column; gap: 0.625rem;
  max-width: 380px; margin: 0 auto; width: 100%; align-items: center;
}
.signin-form {
  display: flex; flex-direction: column; gap: 0.625rem;
  max-width: 380px; margin: 0 auto; width: 100%; align-items: center;
}
.signin-form input {
  padding: 0.9rem 1.125rem; border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md); font-family: inherit; font-size: 1rem;
  background: rgba(255,255,255,0.07); color: #fff; width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.signin-form input:focus {
  outline: none; border-color: var(--c-blue-bright);
  box-shadow: 0 0 0 3px rgba(74,142,240,0.2);
  background: rgba(255,255,255,0.11);
}
.signin-form input::placeholder { color: rgba(255,255,255,0.3); }
.form-error {
  color: var(--c-pink); font-size: 0.875rem; font-weight: 600;
  text-align: center; padding: 0.25rem; width: 100%;
}
.signup-title { text-align: center; font-size: 1.5rem; font-weight: 700; color: #fff; margin-bottom: 0.25rem; }
.guest-note { text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.38); margin-top: 0.25rem; }
.signin-gap { height: 0.75rem; }

/* ===== PILLS / BUTTONS ===== */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.875rem 1.5rem; border: none; border-radius: var(--radius-pill);
  font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: all var(--transition-fast); box-shadow: var(--shadow-sm);
  width: 100%; max-width: 380px; margin: 0 auto; letter-spacing: 0.01em;
}
.pill:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pill:active { transform: translateY(0) scale(0.98); }

.pill-blue   { background: var(--c-blue);   color: #fff; }
.pill-blue:hover   { background: #2060c0; }
.pill-pink   { background: var(--c-pink);   color: #fff; }
.pill-pink:hover   { background: #d13350; }
.pill-green  { background: var(--c-green);  color: #fff; }
.pill-green:hover  { background: #248a45; }
.pill-orange { background: var(--c-orange); color: #fff; }
.pill-orange:hover { background: #e0702d; }
.pill-navy   { background: rgba(30,58,95,0.9); color: #fff; border: 1px solid rgba(74,142,240,0.25); }
.pill-navy:hover   { background: rgba(30,58,95,1); }
.pill-duel   { background: linear-gradient(135deg, #5c1a7a, #1a4a7a); color: #fff; border: 1px solid rgba(160,80,220,0.35); }
.pill-duel:hover   { background: linear-gradient(135deg, #7a2a9a, #2a5a9a); }
.pill-coming-soon  { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.45); border: 1px dashed rgba(255,255,255,0.18); cursor: pointer; }
.pill-coming-soon:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.28); }
.mode-badge-soon   { background: rgba(255,200,60,0.14) !important; color: #f0b840 !important; border: 1px solid rgba(240,184,64,0.3) !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; border: none; border-radius: var(--radius-md);
  font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-primary { background: var(--c-blue); color: #fff; }
.btn-primary:hover { background: #2060c0; transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,0.08); color: var(--c-text);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover { background: rgba(255,255,255,0.14); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-danger { background: rgba(235,66,95,0.15); color: #f07090; border: 1px solid rgba(235,66,95,0.25); }
.btn-danger:hover { background: rgba(235,66,95,0.25); }

.link-btn {
  background: none; border: none; color: var(--c-blue-bright); font-family: inherit;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: #7eb8ff; }
.link-btn.subtle { color: var(--c-text-muted); text-decoration: none; }
.link-btn.subtle:hover { color: var(--c-text); text-decoration: underline; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ===== TOP BAR ===== */
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; }
.top-right { display: flex; align-items: center; gap: 0.625rem; }
.menu-signout-btn { font-size: 0.72rem; opacity: 0.6; padding: 0.25rem 0.65rem; }

.profile-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.875rem 0.35rem 0.45rem;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-pill); cursor: pointer;
  transition: all var(--transition-fast); box-shadow: var(--shadow-sm);
}
.profile-chip:hover { background: rgba(255,255,255,0.12); border-color: rgba(74,142,240,0.4); }
.profile-chip-static { cursor: default; }
.profile-chip-static:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.14); }
.profile-name { font-weight: 700; font-size: 0.875rem; color: var(--c-text); }
.profile-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #1a2a4a, #0a1020);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  position: relative; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}
/* Level pip — small badge in bottom-right of avatar */
.level-pip {
  position: absolute; bottom: -2px; right: -2px;
  background: var(--c-bg); border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 50%; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 800; color: var(--c-cyan);
  line-height: 1;
}
/* Photo fills the chip circle */
.avatar-photo {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.avatar-initial {
  position: relative; z-index: 1;
  font-weight: 800; font-size: inherit; color: #fff;
}
/* Large avatar on profile banner card */
.profile-avatar.avatar-large {
  width: 72px; height: 72px; font-size: 1.6rem;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.22);
}
/* Upload button on banner card */
.avatar-upload-btn {
  position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.avatar-upload-hint {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(255,255,255,0); text-transform: uppercase; white-space: nowrap;
  transition: color 0.2s ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.avatar-upload-btn:hover .avatar-upload-hint { color: rgba(255,255,255,0.9); }
.avatar-upload-btn:hover .profile-avatar.avatar-large { box-shadow: 0 0 0 3px #4a8ef0; }
/* Offset banner content to leave room for the avatar */
.profile-banner-content { padding-left: calc(1.25rem + 72px + 1rem) !important; }

/* ===== MENU ===== */
.menu-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
  flex: 1; align-items: start; padding: 0.25rem 0;
}
@media (max-width: 700px) { .menu-columns { grid-template-columns: 1fr; gap: 1.5rem; } }

.section-title {
  font-size: 0.7rem; font-weight: 700; margin-bottom: 0.875rem;
  color: rgba(255,255,255,0.45); letter-spacing: 0.12em; text-transform: uppercase;
}
.section-title-sub { margin-top: 2rem; }

.mode-list { display: flex; flex-direction: column; gap: 0.5rem; }
.mode-card {
  position: relative; text-align: left; justify-content: flex-start;
  padding-left: 1.125rem; padding-right: 1rem;
  border-radius: var(--radius-md) !important; font-size: 1rem;
  backdrop-filter: blur(6px);
}
.mode-card .pill-label { font-size: 1rem; font-weight: 700; }
.mode-card .mode-badge {
  margin-left: auto; font-size: 0.68rem; font-weight: 700;
  background: rgba(255,255,255,0.15); padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill); letter-spacing: 0.05em; text-transform: uppercase;
}
.mode-card.locked { opacity: 0.4; cursor: not-allowed; filter: grayscale(0.6); }
.mode-card.locked:hover { transform: none; box-shadow: var(--shadow-sm); }

/* ===== SCORE / LEADERBOARD TABS ===== */
.tab-bar {
  display: flex; gap: 0; margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tab-btn {
  background: none; border: none; color: rgba(255,255,255,0.45);
  font-family: inherit; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.5rem 0.875rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tab-btn:hover { color: rgba(255,255,255,0.7); }
.tab-btn.active { color: var(--c-cyan); border-bottom-color: var(--c-cyan); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.score-list { display: flex; flex-direction: column; gap: 0.375rem; }
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid transparent; transition: background var(--transition-fast);
}
.score-row:hover { background: rgba(255,255,255,0.09); }
.score-blue   { border-left-color: var(--c-blue-bright); }
.score-pink   { border-left-color: var(--c-pink); }
.score-orange { border-left-color: var(--c-orange); }
.score-duel   { border-left-color: #a040d0; }
.score-label  { font-weight: 600; font-size: 0.85rem; color: rgba(255,255,255,0.65); }
.score-value  { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; color: var(--c-text); }

/* Leaderboard rows */
.lb-mode-selector {
  display: flex; gap: 0.35rem; margin-bottom: 0.75rem; flex-wrap: wrap;
}
.lb-mode-btn {
  flex: 1; padding: 0.3rem 0.5rem; border-radius: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lb-mode-btn:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.75); }
.lb-mode-btn.active {
  background: rgba(74,142,240,0.18); border-color: rgba(74,142,240,0.45);
  color: #8bbef8;
}
.lb-list { display: flex; flex-direction: column; gap: 0.3rem; }
.lb-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.875rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.07);
  transition: background var(--transition-fast);
}
.lb-row:hover { background: rgba(255,255,255,0.08); }
.lb-row.lb-me { background: rgba(74,142,240,0.1); border-color: rgba(74,142,240,0.2); }
.lb-rank { font-size: 0.75rem; font-weight: 800; color: rgba(255,255,255,0.35); min-width: 22px; }
.lb-rank.gold   { color: #f7d96a; }
.lb-rank.silver { color: #b8c0d0; }
.lb-rank.bronze { color: #c08060; }
.lb-name { font-weight: 600; font-size: 0.875rem; flex: 1; color: var(--c-text); }
.lb-score { font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; color: var(--c-cyan); }
.lb-mode  { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(255,255,255,0.35); }
.lb-empty { text-align: center; padding: 1.5rem; color: rgba(255,255,255,0.3); font-size: 0.875rem; }

.guest-notice {
  margin-top: 0.75rem; padding: 0.75rem;
  background: rgba(235,66,95,0.08); border: 1px solid rgba(235,66,95,0.18);
  border-radius: var(--radius-md); text-align: center; font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
}
.guest-notice button { margin-left: 0.375rem; }

.menu-foot {
  margin-top: auto; padding-top: 1.5rem; text-align: center;
  font-size: 0.78rem; color: rgba(255,255,255,0.28); line-height: 2;
}
.kbd {
  display: inline-block; padding: 0.1rem 0.35rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-bottom-width: 2px; border-radius: 4px; font-family: monospace;
  font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.55); margin: 0 0.1rem;
}

/* ===== PASSWORD EYE TOGGLE ===== */
.pw-wrap {
  position: relative; width: 100%;
}
.pw-wrap input {
  padding-right: 2.75rem !important;
  width: 100%;
}
.pw-eye {
  position: absolute; right: 0.625rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.4); padding: 0.25rem;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition-fast);
  border-radius: 4px;
}
.pw-eye:hover { color: rgba(255,255,255,0.8); }
.pw-eye svg { width: 18px; height: 18px; }

/* ===== PROFILE SCREEN ===== */
.profile-section { max-width: 520px; margin: 0 auto; width: 100%; }

/* Profile Banner Card */
.profile-banner-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  height: 130px; margin-bottom: 0.375rem;
  background: linear-gradient(135deg, #1a3050, #162238);
  box-shadow: var(--shadow-md); border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.5s ease;
}
.profile-banner-content {
  position: absolute; inset: 0; padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; justify-content: flex-end; z-index: 2;
}
.profile-name-main { font-size: 1.5rem; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.profile-banner-level {
  display: inline-flex; align-items: center;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill); padding: 0.15rem 0.6rem;
  font-size: 0.72rem; font-weight: 800; color: var(--c-cyan);
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 0.35rem;
  width: fit-content;
}
/* TETRITYPE! watermark logo diagonal on the right */
.banner-logo-watermark {
  position: absolute; right: -20px; top: 50%; transform: translateY(-50%) rotate(-20deg);
  width: 220px; height: auto; opacity: 0.08;
  filter: invert(1); z-index: 1; pointer-events: none;
  user-select: none;
}

/* Level / XP bar below banner */
.level-xp-row {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; padding: 0 0.25rem;
}
.level-bar-wrap {
  flex: 1; height: 5px; background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
}
.level-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--c-blue-bright), var(--c-cyan));
  border-radius: 3px; transition: width 0.5s ease;
}
.level-xp-text {
  font-size: 0.72rem; color: rgba(255,255,255,0.45); white-space: nowrap;
  font-weight: 600; min-width: 160px; text-align: right;
}

/* Achievement Badges */
.achievement-badges-row {
  display: flex; gap: 0.85rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.achievement-badge {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 0.65rem 1rem; min-width: 90px;
  transition: border-color 0.2s, background 0.2s;
}
.achievement-badge.earned {
  background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.22);
}
.ach-medal {
  width: 36px; height: 36px; border-radius: 50%;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.35);
  position: relative;
}
.ach-medal::after {
  content: '🏅'; font-size: 26px; line-height: 36px;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  filter: grayscale(1) opacity(0.3);
}
.achievement-badge.earned .ach-medal::after { filter: none; }
.ach-bronze::after { content: '🥉'; }
.ach-silver::after { content: '🥈'; }
.ach-gold::after   { content: '🥇'; }
.ach-label {
  font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.45);
  text-align: center; text-transform: uppercase; letter-spacing: 0.05em;
}
.achievement-badge.earned .ach-label { color: rgba(255,255,255,0.78); }
.ach-count {
  font-size: 1rem; font-weight: 800; color: rgba(255,255,255,0.2);
  min-width: 22px; height: 22px; line-height: 22px; text-align: center;
  background: rgba(255,255,255,0.07); border-radius: 11px; padding: 0 6px;
}
.achievement-badge.earned .ach-count { color: #fff; background: rgba(255,255,255,0.18); }

/* Banner picker swatches */
.banner-picker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.banner-swatch {
  height: 48px; border-radius: var(--radius-md); border: 2px solid transparent;
  cursor: pointer; position: relative; overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.banner-swatch:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.banner-swatch.selected {
  border-color: #fff; box-shadow: 0 0 0 3px rgba(94,216,216,0.4);
}
.banner-swatch-label {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 3px; font-size: 0.52rem; font-weight: 800; color: rgba(255,255,255,0.75);
  letter-spacing: 0.05em; text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 100%);
}

/* Friend search */
.friend-search-row {
  display: flex; gap: 0.5rem; margin-bottom: 0.875rem;
}
.friend-search-input {
  flex: 1; padding: 0.6rem 0.875rem;
  background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md); font-family: inherit; font-size: 0.875rem; color: var(--c-text);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.friend-search-input:focus { outline: none; border-color: var(--c-blue-bright); background: rgba(255,255,255,0.1); }
.friend-search-input::placeholder { color: rgba(255,255,255,0.3); }

.friend-list { display: flex; flex-direction: column; gap: 0.375rem; }
.friend-row {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 0.875rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  transition: background var(--transition-fast);
}
.friend-row:hover { background: rgba(255,255,255,0.09); }
.friend-row.pending { border-color: rgba(245,129,61,0.25); background: rgba(245,129,61,0.06); }
.friend-row.request { border-color: rgba(74,142,240,0.25); background: rgba(74,142,240,0.06); }
.friend-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem; color: #fff;
}
.friend-name { font-weight: 600; font-size: 0.875rem; flex: 1; color: var(--c-text); }
.friend-status {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: rgba(255,255,255,0.4);
}
.friend-actions { display: flex; gap: 0.3rem; }

/* Swatch colors for friend avatars */
.fr-orange .friend-avatar { background: var(--c-orange); }
.fr-green  .friend-avatar { background: var(--c-green); }
.fr-pink   .friend-avatar { background: var(--c-pink); }
.fr-navy   .friend-avatar { background: #2a4a7a; }
.fr-blue   .friend-avatar { background: var(--c-blue); }
.fr-purple .friend-avatar { background: var(--c-purple); }
.fr-cyan   .friend-avatar { background: #1a9090; }
.fr-amber  .friend-avatar { background: #a07830; }

/* Search results panel */
.friend-search-results {
  margin-top: 0.375rem; border-radius: var(--radius-md);
  background: rgba(20,24,36,0.95); border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden; box-shadow: var(--shadow-md);
}
.search-result-row {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 0.875rem; border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background var(--transition-fast);
}
.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: rgba(255,255,255,0.07); }
.search-result-name { flex: 1; font-weight: 600; font-size: 0.875rem; }
.no-results { padding: 0.875rem; text-align: center; color: rgba(255,255,255,0.35); font-size: 0.8rem; }

/* Pending requests section */
.requests-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--c-pink); color: #fff;
  font-size: 0.65rem; font-weight: 800; margin-left: 0.35rem;
}

/* ===== PLAY SCREEN ===== */
.play-top {
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,14,22,0.7); backdrop-filter: blur(10px);
  position: relative; z-index: 2;
}
.play-meta { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.player-chip, .mode-chip {
  padding: 0.25rem 0.7rem; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 700;
}
.player-chip { background: rgba(255,255,255,0.1); color: var(--c-text); border: 1px solid rgba(255,255,255,0.12); }
.mode-chip   { background: rgba(42,108,211,0.3); color: #7eb8ff; border: 1px solid rgba(42,108,211,0.3); }

.round-badge {
  padding: 0.25rem 0.7rem; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.round-badge.r1 { background: rgba(46,158,83,0.15); color: #6dd898; border: 1px solid rgba(46,158,83,0.3); }
.round-badge.r2 { background: rgba(245,129,61,0.15); color: #f5a870; border: 1px solid rgba(245,129,61,0.3); }
.round-badge.r3 { background: rgba(124,44,138,0.15); color: #c080d8; border: 1px solid rgba(124,44,138,0.3); }

/* Combo badge in top bar */
.combo-chip {
  padding: 0.25rem 0.7rem; border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em;
  background: rgba(247,217,106,0.15); color: var(--c-amber);
  border: 1px solid rgba(247,217,106,0.28);
  opacity: 0; transition: opacity 0.2s ease;
  display: none;
}
.combo-chip.visible { opacity: 1; display: inline-flex; }

.play-body {
  display: flex; flex: 1; min-height: 0; padding: 0.75rem 1rem; gap: 0.875rem;
  max-width: 1200px; margin: 0 auto; width: 100%; align-items: center;
  position: relative; z-index: 2; justify-content: center; overflow: visible;
}

/* ===== HUD PANELS ===== */
.side-hud {
  display: flex; flex-direction: column; gap: 0.35rem;
  min-width: 165px; width: 165px; flex-shrink: 0;
}
.side-hud.right { width: 185px; min-width: 185px; }

.hud-row {
  display: flex; flex-direction: column;
  padding: 0.5rem 0.7rem; border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 3px 14px rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
}
.hud-label {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; opacity: 0.7; margin-bottom: 0.08rem;
}
.hud-value {
  font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.hud-blue    { background: rgba(24,70,150,0.75); }
.hud-blue    .hud-label, .hud-blue    .hud-value { color: #a8d0ff; }
.hud-pink    { background: rgba(160,30,55,0.75); }
.hud-pink    .hud-label, .hud-pink    .hud-value { color: #ffaabb; }
.hud-orange  { background: rgba(160,70,10,0.75); }
.hud-orange  .hud-label, .hud-orange  .hud-value { color: #ffcb90; }
.hud-green   { background: rgba(14,88,38,0.75); }
.hud-green   .hud-label, .hud-green   .hud-value { color: #90dda0; }
.hud-wpm     { background: rgba(120,50,10,0.75); }
.hud-wpm     .hud-label, .hud-wpm     .hud-value { color: #ffb870; }
.hud-acc     { background: rgba(10,80,40,0.75); }
.hud-acc     .hud-label, .hud-acc     .hud-value { color: #80eaa0; }
.hud-purple  { background: rgba(48,20,100,0.75); }
.hud-purple  .hud-label, .hud-purple  .hud-value { color: #c8a0f0; }
.hud-bar {
  height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 3px; margin-top: 0.3rem; overflow: hidden;
}
.hud-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.35s ease;
  background: rgba(255,255,255,0.6);
}

.error-pips { display: flex; gap: 4px; margin-top: 0.3rem; }
/* Under-board pip row */
.under-board-pips {
  display: flex; justify-content: center; gap: 8px;
  padding: 6px 0 2px;
  width: 100%;
}
body.duel-active .under-board-pips { display: none; }
.pip {
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background var(--transition-fast), transform 0.1s ease, box-shadow 0.12s ease;
}
.pip.active {
  background: #ff4d6d;
  box-shadow: 0 0 8px rgba(255,77,109,0.9);
  transform: scale(1.25);
}

.hud-buttons { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.375rem; }

/* ===== BOARD ===== */
.tower-area { display: flex; justify-content: center; flex-shrink: 0; }

/* ===== DUEL MODE ===== */
.duel-player-label {
  font-size: 0.72rem; font-weight: 900; letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5); text-transform: uppercase; text-align: center;
  padding: 0.2rem 0.5rem; align-self: center;
}
.duel-bot-label { color: rgba(200,130,255,0.8); }

body.duel-active .play-body { gap: 0.25rem; }
body.duel-active .tower-area {
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  flex-wrap: nowrap;
  flex: 1;
}
.duel-zone-player {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.duel-bot-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.duel-bot-inner {
  display: flex; flex-direction: row; align-items: flex-end; gap: 0.4rem;
}
.duel-vs-divider {
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-lr; font-weight: 900; font-size: 1.1rem;
  letter-spacing: 0.18em; color: rgba(255,255,255,0.28);
  padding: 0 0.2rem; align-self: center;
}
/* Larger canvases in duel — give each tower real room */
body.duel-active #game,
body.duel-active #duelCanvas {
  width: 270px !important; height: 675px !important;
}
body.duel-active .board-wrap { border-radius: 8px; }
body.duel-active #rightHud { display: none !important; }
body.duel-active #duelPlayerLabel { display: block !important; }
body.duel-active .side-hud.left { display: none !important; }

/* Mini Next/Hold boxes shown in each duel zone */
.duel-next-hold {
  display: flex; flex-direction: column; gap: 0.35rem; align-items: center;
}
.duel-next-hold-player { order: -1; }  /* left of player board */
.duel-next-hold-bot    { order: -1; }  /* left of bot board */
.duel-mini-box {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px; padding: 0.25rem;
}
.duel-mini-box canvas { display: block; width: 72px; height: 72px; }
.duel-mini-label {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.45); text-transform: uppercase;
}
/* Bot stats row below bot board */
.duel-bot-hud {
  display: flex; flex-direction: row; gap: 0.4rem;
  justify-content: center; width: 100%; padding: 0.2rem 0;
}
.duel-bot-hud .hud-row {
  padding: 0.25rem 0.5rem; font-size: 0.78rem; border-radius: 6px;
}
.duel-bot-hud .hud-value { font-size: 0.85rem; }
.board-wrap {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.08);
}
#game {
  display: block;
  height: min(900px, calc(100dvh - 130px));
  width: calc(min(900px, calc(100dvh - 130px)) * 0.4);
}

/* Word banner */
.word-banner {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 0.3rem 0.4rem;
  display: flex; justify-content: center; align-items: center; gap: 2px;
  pointer-events: none; z-index: 8;
  background: rgba(8,12,22,0.88); backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(94,216,216,0.5);
  transition: opacity 0.2s ease;
}
.word-banner.hidden-banner { opacity: 0; }
.word-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 23px; height: 25px; border-radius: 4px;
  background: rgba(255,255,255,0.08);
  font-weight: 800; font-size: 0.85rem; color: rgba(220,225,240,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.word-letter.typed {
  background: rgba(46,158,83,0.22); border-color: rgba(46,158,83,0.35);
  color: rgba(120,220,140,0.45);
}
.word-letter.active-letter {
  background: rgba(94,216,216,0.22); border-color: rgba(94,216,216,0.7);
  color: var(--c-cyan); box-shadow: 0 0 12px rgba(94,216,216,0.4);
  animation: letter-pulse 0.65s ease infinite alternate;
}
@keyframes letter-pulse {
  from { box-shadow: 0 0 5px rgba(94,216,216,0.3); }
  to   { box-shadow: 0 0 16px rgba(94,216,216,0.7); }
}

/* Feedback text */
.feedback {
  position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%); font-size: 1.5rem; font-weight: 900;
  text-align: center; pointer-events: none; opacity: 0;
  transition: opacity 0.12s ease; white-space: nowrap; z-index: 10;
  letter-spacing: 0.03em;
}
.feedback.show   { opacity: 1; }
.feedback.good   { color: #4ddd78; text-shadow: 0 2px 20px rgba(46,158,83,0.7); }
.feedback.danger { color: #ff4d6d; text-shadow: 0 2px 20px rgba(255,77,109,0.7); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-7px); }
  40%  { transform: translateX(7px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
}
.board-wrap.shake { animation: shake 0.35s ease-in-out; }

/* ── Tower Border Themes ── */
.board-wrap.tower-white  { border: 2px solid rgba(255,255,255,0.5); box-shadow: 0 0 40px rgba(0,0,0,0.6); }
.board-wrap.tower-gold   { border: 2px solid rgba(247,217,106,0.85); box-shadow: 0 0 28px rgba(247,217,106,0.45), 0 0 60px rgba(0,0,0,0.6); }
.board-wrap.tower-neon   { border: 2px solid rgba(0,255,255,0.85); box-shadow: 0 0 28px rgba(0,255,255,0.4), 0 0 60px rgba(0,0,0,0.6); }
.board-wrap.tower-pink   { border: 2px solid rgba(240,112,144,0.85); box-shadow: 0 0 28px rgba(240,112,144,0.4), 0 0 60px rgba(0,0,0,0.6); }
.board-wrap.tower-purple { border: 2px solid rgba(196,155,217,0.85); box-shadow: 0 0 28px rgba(196,155,217,0.45), 0 0 60px rgba(0,0,0,0.6); }
.board-wrap.tower-rainbow {
  border: 2px solid transparent;
  background-clip: padding-box;
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px rgba(255,80,80,0.8), 0 0 28px rgba(120,80,255,0.4), 0 0 60px rgba(0,0,0,0.6);
  animation: tower-rainbow-border 4s linear infinite;
}
@keyframes tower-rainbow-border {
  0%   { box-shadow: 0 0 0 2px rgba(255,80,80,0.9),  0 0 30px rgba(255,80,80,0.35),  0 0 60px rgba(0,0,0,0.6); }
  17%  { box-shadow: 0 0 0 2px rgba(255,165,0,0.9),  0 0 30px rgba(255,165,0,0.35),  0 0 60px rgba(0,0,0,0.6); }
  33%  { box-shadow: 0 0 0 2px rgba(60,220,100,0.9), 0 0 30px rgba(60,220,100,0.35), 0 0 60px rgba(0,0,0,0.6); }
  50%  { box-shadow: 0 0 0 2px rgba(0,200,255,0.9),  0 0 30px rgba(0,200,255,0.35),  0 0 60px rgba(0,0,0,0.6); }
  67%  { box-shadow: 0 0 0 2px rgba(120,60,255,0.9), 0 0 30px rgba(120,60,255,0.35), 0 0 60px rgba(0,0,0,0.6); }
  83%  { box-shadow: 0 0 0 2px rgba(255,0,200,0.9),  0 0 30px rgba(255,0,200,0.35),  0 0 60px rgba(0,0,0,0.6); }
  100% { box-shadow: 0 0 0 2px rgba(255,80,80,0.9),  0 0 30px rgba(255,80,80,0.35),  0 0 60px rgba(0,0,0,0.6); }
}

/* Side boxes */
.side-box {
  padding: 0.5rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  text-align: center; margin-bottom: 0.3rem; box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}
.box-label {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(255,255,255,0.45); margin-bottom: 0.3rem;
}
.side-box canvas { display: block; margin: 0 auto; }

/* ===== MULTIPLIER BADGE ===== */
.multiplier-badge {
  position: relative; width: 160px; height: 160px; margin: 0.2rem auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent; flex-shrink: 0;
  isolation: isolate;
  transition: width 0.5s ease, height 0.5s ease;
}
/* Canvas badge fills the container; all animation is drawn in JS */
.multiplier-badge canvas {
  position: relative; z-index: 2;
  width: 100%; height: 100%; display: block;
}

/* Tier sizes — grow with rank */
.multiplier-badge[data-tier="3"] { width: 172px; height: 172px; }
.multiplier-badge[data-tier="4"] { width: 184px; height: 184px; }
.multiplier-badge[data-tier="5"] { width: 196px; height: 196px; }

@keyframes mult-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.3) rotate(-4deg); }
  65%  { transform: scale(0.96) rotate(2deg); }
  100% { transform: scale(1); }
}
.mult-bump { animation: mult-bump 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.mult-rim { display: none; }
.mult-x   { display: none; }

/* Tutorial */
.tutorial-hint {
  padding: 0.7rem; border-radius: var(--radius-md);
  background: rgba(42,108,211,0.12); border: 1px solid rgba(42,108,211,0.22);
  margin-top: 0.3rem; backdrop-filter: blur(4px);
}
.tut-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.35rem; gap: 0.5rem;
}
.tut-step {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--c-blue-bright);
}
.tut-action-badge {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  background: rgba(42,108,211,0.22); border: 1px solid rgba(42,108,211,0.45);
  color: #7ab8ff; white-space: nowrap;
  animation: tut-badge-pulse 1.4s ease-in-out infinite;
}
@keyframes tut-badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(42,108,211,0.35); }
  50%       { box-shadow: 0 0 0 5px rgba(42,108,211,0); }
}
.tut-text { font-size: 0.78rem; line-height: 1.5; margin-bottom: 0.5rem; color: rgba(255,255,255,0.8); }

/* ===== OVERLAYS ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(4,6,12,0.92); backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center; z-index: 20;
}
.overlay[hidden], [hidden] { display: none !important; }
.overlay-inner { text-align: center; padding: 2rem; max-width: 400px; width: 100%; }
.overlay-inner h2 {
  font-size: 1.875rem; font-weight: 900; margin-bottom: 1.125rem;
  letter-spacing: -0.02em; color: var(--c-text);
}
.overlay-inner .btn { margin-bottom: 0.5rem; width: 100%; }

.final-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem;
}
.final-stats > div {
  display: flex; flex-direction: column; padding: 0.75rem;
  background: rgba(255,255,255,0.07); border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.1);
}
.final-stats span {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.55); margin-bottom: 0.2rem;
}
.final-stats b { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--c-text); }

.result-banner {
  padding: 0.8rem; border-radius: var(--radius-md); margin-bottom: 1rem;
  font-weight: 600; text-align: center; font-size: 0.875rem; line-height: 1.5;
}
.result-banner.win {
  background: rgba(46,158,83,0.12); border: 1px solid rgba(46,158,83,0.25); color: #7ddd98;
}
.result-banner.loss {
  background: rgba(220,55,75,0.12); border: 1px solid rgba(220,55,75,0.25); color: #f07080;
}
.result-banner.transcendent {
  background: linear-gradient(135deg, rgba(245,129,61,0.15), rgba(196,155,217,0.15));
  border: 1px solid rgba(245,129,61,0.35); color: var(--c-amber);
  animation: pulse-glow 2s ease infinite;
}
@keyframes pulse-glow {
  0%,100% { box-shadow: 0 0 20px rgba(245,129,61,0.08); }
  50%      { box-shadow: 0 0 40px rgba(245,129,61,0.25); }
}

.pg-sub  { font-size: 1.125rem; font-weight: 900; margin-bottom: 0.4rem; }
.pg-body { font-size: 0.875rem; line-height: 1.55; opacity: 0.85; }

.play-footer { text-align: center; padding: 0.6rem; position: relative; z-index: 2; }

/* ===== PERFECT GAME / ROUND TRANSITION SCREENS ===== */
.perfect-game-screen {
  position: fixed; inset: 0; z-index: 200;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 1.5rem; overflow-y: auto;
  transition: opacity 0.5s ease;
}
.perfect-game-screen.pg-r1,
.perfect-game-screen.pg-r2 { backdrop-filter: none; }
/* Round 1 → 2: dark semi-transparent so desert shows through */
.perfect-game-screen.pg-r1 {
  background: rgba(8, 5, 2, 0.72);
}
.perfect-game-screen.pg-r1 .pg-subtitle { color: #fff; }
.perfect-game-screen.pg-r1 .pg-body-text { color: rgba(255,235,200,0.85); }
/* Round 2 → 3: dark semi-transparent so galaxy shows through */
.perfect-game-screen.pg-r2 {
  background: rgba(4, 3, 10, 0.75);
}
.perfect-game-screen.pg-r2 .pg-subtitle { color: #fff; }
.perfect-game-screen.pg-r2 .pg-body-text { color: rgba(200,210,255,0.85); }
.pg-content {
  text-align: center; max-width: 560px; width: 100%; display: flex; flex-direction: column; align-items: center;
  animation: pg-pop-in 0.5s cubic-bezier(0.22,1,0.36,1);
}
@keyframes pg-pop-in { from { opacity:0; transform:scale(0.9) translateY(24px); } to { opacity:1; transform:scale(1) translateY(0); } }
.pg-title-img {
  max-width: 500px; width: 100%; height: auto; margin: 0 auto 0.75rem; display: block;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,0.22));
  animation: pg-title-drop 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.05s both;
}
@keyframes pg-title-drop {
  from { opacity:0; transform: scale(0.75) rotate(-4deg); }
  to   { opacity:1; transform: scale(1) rotate(0deg); }
}
.pg-subtitle {
  font-size: 1.5rem; font-weight: 900; color: #111; margin-bottom: 0.4rem;
  letter-spacing: -0.01em; text-transform: uppercase;
}
.pg-body-text {
  font-size: 0.875rem; line-height: 1.55; color: #333;
  margin-bottom: 1.25rem; max-width: 440px; text-align: center;
  font-weight: 500;
}
.pg-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  margin-bottom: 1.25rem; width: 100%; max-width: 460px;
}
.pg-stat-box {
  padding: 0.875rem 1.125rem; border-radius: var(--radius-lg);
  color: #fff; text-align: left; display: flex; flex-direction: column; gap: 0.15rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.pg-stat-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; opacity: 0.85; }
.pg-stat-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Action buttons for pg screens */
.pg-action-primary {
  width: 100%; max-width: 340px; padding: 1rem 1.5rem;
  border: none; border-radius: var(--radius-pill); cursor: pointer;
  font-size: 1.1rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 0.5rem; transition: transform 0.15s, filter 0.15s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.pg-action-primary:hover { transform: scale(1.03); filter: brightness(1.08); }
.pg-action-primary:active { transform: scale(0.98); }
.pg-action-primary.blue { background: linear-gradient(135deg, #2a6cd4, #4a9ef0); color: #fff; }
.pg-action-primary.gold { background: linear-gradient(135deg, #d4960a, #f7d240); color: #222; }
.pg-action-secondary {
  width: 100%; max-width: 340px; padding: 0.85rem 1.5rem;
  border: none; border-radius: var(--radius-pill); cursor: pointer;
  background: #111; color: #fff;
  font-size: 1rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.pg-action-secondary:hover { background: #222; transform: scale(1.02); }
.pg-action-secondary:active { transform: scale(0.97); }

/* ===== MATCHMAKING SCREEN ===== */
.mm-page { justify-content: center; align-items: center; }
.mm-card {
  display: flex; flex-direction: column; align-items: center; gap: 1.1rem;
  background: rgba(20,20,30,0.92); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 2.5rem 2rem; max-width: 360px; width: 100%;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  text-align: center;
}
.mm-mode-tag {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.2em;
  color: var(--c-blue-bright); background: rgba(74,142,240,0.15);
  border: 1px solid rgba(74,142,240,0.3); border-radius: 20px;
  padding: 0.2rem 0.8rem;
}
.mm-title { font-size: 1.6rem; font-weight: 800; margin: 0; color: #fff; }
.mm-online-row {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: rgba(255,255,255,0.45);
}
.mm-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ddc84; box-shadow: 0 0 6px #3ddc84;
  animation: mm-pulse 1.8s ease-in-out infinite;
}
@keyframes mm-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}
.mm-spinner-wrap {
  position: relative; width: 80px; height: 80px; margin: 0.5rem auto;
  display: flex; align-items: center; justify-content: center;
}
.mm-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(74,142,240,0.2);
  border-top-color: var(--c-blue-bright);
  animation: mm-spin 1.2s linear infinite;
}
.mm-ring-inner {
  position: absolute; inset: 10px; border-radius: 50%;
  border: 2px solid rgba(236,72,153,0.2);
  border-bottom-color: #ec4899;
  animation: mm-spin 1.8s linear infinite reverse;
}
.mm-avatar-q {
  font-size: 1.8rem; font-weight: 900; color: rgba(255,255,255,0.3);
}
@keyframes mm-spin { to { transform: rotate(360deg); } }
.mm-status-text {
  font-size: 0.92rem; color: rgba(255,255,255,0.6); margin: 0;
}
.mm-ellipsis::after {
  content: ''; animation: mm-dots 1.4s steps(4, end) infinite;
}
@keyframes mm-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}
.mm-actions { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.mm-hint { font-size: 0.72rem; color: rgba(255,255,255,0.3); margin: 0; }
.mm-back-btn { font-size: 0.8rem; opacity: 0.5; margin-top: 0.5rem; }
.mm-back-btn:hover { opacity: 1; }

/* Found state */
.mm-found-icon { font-size: 2.8rem; }
.mm-found-label {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.2em;
  color: #3ddc84; background: rgba(61,220,132,0.12);
  border: 1px solid rgba(61,220,132,0.3); border-radius: 20px;
  padding: 0.2rem 0.8rem;
}
.mm-found-name {
  font-size: 1.3rem; font-weight: 800; color: #fff;
  background: rgba(255,255,255,0.07); border-radius: 8px;
  padding: 0.4rem 1.2rem;
}
.mm-starting { color: rgba(255,255,255,0.4); font-size: 0.85rem; }

/* ===== DUEL SCORE COMPARISON ===== */
.duel-score-comparison {
  display: flex; align-items: center; gap: 1rem;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 0.9rem 1rem; width: 100%;
  justify-content: center; margin: 0.25rem 0;
}
.dsc-col {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  flex: 1;
}
.dsc-name {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
}
.dsc-score {
  font-size: 1.25rem; font-weight: 800; color: #fff;
}
.dsc-vs {
  font-size: 0.65rem; font-weight: 900; letter-spacing: 0.15em;
  color: rgba(255,255,255,0.25);
}
.dsc-you.winner .dsc-score { color: #3ddc84; }
.dsc-opp.winner .dsc-score { color: #ec4899; }
.dsc-you.winner .dsc-name, .dsc-opp.winner .dsc-name { color: rgba(255,255,255,0.7); }

/* ===== STATS (profile page) ===== */
.stats-mode-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.stats-mode-tab {
  padding: 0.3rem 0.75rem; font-size: 0.75rem; font-weight: 700;
  border-radius: 99px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.55);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.stats-mode-tab.active { background: var(--c-blue); color: #fff; border-color: var(--c-blue); }
.stats-summary-row {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 0.5rem; margin-bottom: 0.75rem;
}
.stat-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); padding: 0.5rem 0.4rem; text-align: center;
}
.stat-card-val { font-size: 1.1rem; font-weight: 900; color: var(--c-text); }
.stat-card-lbl { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.5; margin-top: 0.1rem; }
.wpm-chart-wrap {
  position: relative; width: 100%; margin-bottom: 0.75rem;
}
.wpm-chart {
  display: block; width: 100%; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
.wpm-chart-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; opacity: 0.38; pointer-events: none;
}
.wpm-history-table {
  display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem;
  max-height: 180px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.wpm-hist-row {
  display: grid; grid-template-columns: 1fr 2.5rem 2.5rem 3rem 4.5rem;
  gap: 0.4rem; align-items: center;
  padding: 0.3rem 0.5rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.035); font-size: 0.75rem;
}
.wpm-hist-row .h-wpm { font-weight: 800; color: var(--c-blue-bright); }
.wpm-hist-row .h-acc { opacity: 0.7; }
.wpm-hist-row .h-score { opacity: 0.7; }
.wpm-hist-row .h-date { opacity: 0.4; font-size: 0.65rem; text-align: right; }
.wpm-hist-row .h-badge { font-size: 0.58rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 99px; text-align: center; }
.h-badge.win { background: rgba(61,220,132,0.18); color: #3ddc84; }
.h-badge.loss { background: rgba(240,85,107,0.15); color: #f0556b; }

/* ===== CUSTOMIZATION (profile page) ===== */
.custom-subsection {
  margin-bottom: 1.1rem;
}
.custom-sub-label {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; opacity: 0.55; margin-bottom: 0.45rem;
}
.custom-sub-hint {
  font-weight: 500; opacity: 0.65; text-transform: none; letter-spacing: 0;
}
.avatar-border-picker {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.avatar-border-swatch {
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 900; transition: transform 0.15s;
  position: relative;
}
.avatar-border-swatch::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.avatar-border-swatch.selected::after { border-color: #fff; }
.avatar-border-swatch:hover { transform: scale(1.08); }
.piece-theme-picker {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.piece-theme-btn {
  display: flex; gap: 2px; padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); cursor: pointer;
  transition: all 0.15s; flex-direction: column; align-items: center; gap: 0.3rem;
}
.piece-theme-btn.selected { border-color: var(--c-blue); background: rgba(32,96,192,0.2); }
.piece-theme-btn:hover { border-color: rgba(255,255,255,0.25); }
.piece-theme-dots { display: flex; gap: 2px; }
.piece-theme-dot { width: 8px; height: 8px; border-radius: 2px; }
.piece-theme-name { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.font-picker {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.font-btn {
  padding: 0.35rem 0.75rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); cursor: pointer; font-size: 0.82rem;
  font-family: inherit; color: var(--c-text); transition: all 0.15s;
}
.font-btn.selected { border-color: var(--c-blue); background: rgba(32,96,192,0.2); }
.font-btn:hover { border-color: rgba(255,255,255,0.25); }
.keybind-table {
  display: flex; flex-direction: column; gap: 0.25rem;
}
.keybind-row {
  display: grid; grid-template-columns: 1fr 5rem;
  align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03); cursor: pointer;
  transition: background 0.12s;
}
.keybind-row:hover { background: rgba(255,255,255,0.06); }
.keybind-row.listening { background: rgba(32,96,192,0.22); border-color: var(--c-blue); }
.keybind-action { font-size: 0.78rem; opacity: 0.8; }
.keybind-key {
  font-size: 0.72rem; font-weight: 800; font-family: 'Courier New', monospace;
  padding: 0.2rem 0.4rem; border-radius: 4px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.keybind-row.listening .keybind-key { color: var(--c-blue-bright); border-color: var(--c-blue); background: rgba(32,96,192,0.15); }

/* ===== DANGER ZONE (profile page) ===== */
.customize-save-row {
  display: flex; justify-content: flex-end;
  margin-top: 1.75rem;
}
.customize-save-row .btn-primary {
  min-width: 140px; font-weight: 700; letter-spacing: 0.04em;
}
.customize-save-row .btn-saved {
  background: #27ae60 !important;
  pointer-events: none;
}
.danger-zone {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2rem; padding: 0.75rem 1rem;
  border: 1px solid rgba(235,66,95,0.22);
  border-radius: var(--radius-md);
  background: rgba(235,66,95,0.05);
}
.danger-zone-label {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(235,66,95,0.6);
}

/* ===== DELETE ACCOUNT MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
  background: var(--c-surface); border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg); padding: 1.75rem 2rem;
  max-width: 420px; width: 90%; box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-title {
  font-size: 1.3rem; font-weight: 900; margin: 0 0 0.75rem; color: #f07090;
}
.modal-body {
  font-size: 0.88rem; line-height: 1.55; opacity: 0.78; margin: 0 0 0.6rem;
}
.modal-input {
  width: 100%; box-sizing: border-box;
  padding: 0.55rem 0.75rem; margin: 0.4rem 0 1.1rem;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm); color: var(--c-text); font-family: inherit;
  font-size: 0.95rem; outline: none;
}
.modal-input:focus { border-color: rgba(235,66,95,0.5); }
.modal-actions {
  display: flex; gap: 0.75rem; justify-content: flex-end;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 920px) {
  .play-body { flex-direction: column; align-items: center; padding: 0.5rem; gap: 0.5rem; }
  .side-hud.left, .side-hud.right { width: 100%; max-width: 360px; flex-direction: row; flex-wrap: wrap; min-width: unset; }
  .hud-row { flex: 1; min-width: 90px; }
  .tower-area { order: -1; }
}
@media (max-width: 480px) {
  .page { padding: 1rem; }
  .brand-wordmark { max-width: 200px; }
  .overlay-inner h2 { font-size: 1.4rem; }
  .final-stats b { font-size: 1.1rem; }
  .word-letter { width: 20px; height: 22px; font-size: 0.78rem; }
}

/* ===== TESSARA ATTRIBUTION ===== */
#tessaraBadge {
  position: fixed;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  pointer-events: none;
  user-select: none;
}
.tessara-label {
  font-size: 0.50rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  line-height: 1;
}
.tessara-logo {
  height: 48px;
  width: auto;
  display: block;
  opacity: 0.68;
  filter: drop-shadow(0 2px 10px rgba(100,50,200,0.45));
}
.tessara-copyright {
  font-size: 0.50rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.28);
  white-space: nowrap;
  line-height: 1;
  pointer-events: auto;
}
.tessara-legal-link {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: inherit; font-weight: 600;
  letter-spacing: inherit; color: rgba(160,120,255,0.55);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.tessara-legal-link:hover { color: rgba(180,140,255,0.85); }

/* ===== TERMS OF USE MODAL ===== */
.terms-box {
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.terms-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.terms-logo {
  height: 44px;
  width: auto;
  flex-shrink: 0;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(120,60,220,0.4));
}
.terms-title {
  font-size: 1.15rem;
  font-weight: 900;
  margin: 0 0 0.2rem;
  color: var(--c-text);
}
.terms-effective {
  font-size: 0.72rem;
  opacity: 0.5;
  margin: 0;
}
.terms-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
  flex-shrink: 0;
  transition: color 0.15s;
}
.terms-close-btn:hover { color: rgba(255,255,255,0.9); }
.terms-scroll {
  overflow-y: auto;
  padding: 1.4rem 1.6rem 1.8rem;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.terms-scroll h2 {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(160,120,255,0.9);
  margin: 1.4rem 0 0.4rem;
}
.terms-scroll h2:first-child { margin-top: 0; }
.terms-scroll p {
  font-size: 0.83rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  margin: 0 0 0.6rem;
}
.terms-scroll ul {
  margin: 0.2rem 0 0.8rem 1.2rem;
  padding: 0;
}
.terms-scroll ul li {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.25rem;
}
.terms-footer-note {
  margin-top: 1.8rem !important;
  font-size: 0.72rem !important;
  opacity: 0.38 !important;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 1rem;
}

/* ===== BATTLE ROYALE COMING SOON MODAL ===== */
.br-modal-box {
  background: linear-gradient(160deg, rgba(18,8,40,0.98), rgba(8,10,25,0.98));
  border: 1px solid rgba(200,160,255,0.18);
  text-align: center;
  max-width: 480px;
}
.br-modal-icon {
  font-size: 2.2rem; margin-bottom: 0.5rem; line-height: 1;
}
.br-modal-title {
  font-size: 1.4rem; font-weight: 900; letter-spacing: 0.12em;
  background: linear-gradient(135deg, #c8a0ff, #7ab8ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin: 0 0 1rem;
}
.br-modal-body {
  text-align: left; margin-bottom: 1.5rem;
}
.br-modal-body p {
  font-size: 0.8rem; line-height: 1.7;
  color: rgba(255,255,255,0.72);
  margin: 0 0 0.75rem; letter-spacing: 0.02em;
}
.br-modal-sig {
  font-size: 0.78rem !important; font-weight: 700;
  color: rgba(200,160,255,0.9) !important;
  border-top: 1px solid rgba(200,160,255,0.15);
  padding-top: 0.75rem; margin-top: 0.25rem !important;
}
.br-modal-sig span {
  font-size: 0.7rem; font-weight: 400;
  color: rgba(200,160,255,0.55);
  display: block; margin-top: 0.15rem;
}
