* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 5% -20%, rgba(45, 212, 191, 0.28), transparent 52%),
    radial-gradient(900px 500px at 95% 0%, rgba(56, 189, 248, 0.22), transparent 45%),
    radial-gradient(1000px 500px at 50% 120%, rgba(251, 146, 60, 0.14), transparent 60%),
    linear-gradient(180deg, #042f2e 0%, #0a3a4a 35%, #0f172a 100%);
  color: #e5e7eb;
  min-height: 100vh;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 20px 34px;
}

header {
  position: relative;
  --header-card-width: 620px;
  text-align: center;
  margin-bottom: 20px;
}

.header-menu-wrap {
  position: absolute;
  right: max(0px, calc((100% - min(100%, var(--header-card-width))) / 2));
  top: 0;
  z-index: 40;
}

.header-menu-btn {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #334155, #1e293b);
  box-shadow: 0 8px 18px rgba(2, 8, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.25);
  cursor: pointer;
  color: #e2e8f0;
}

.header-menu-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
  pointer-events: none;
}

.hamburger-line {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: currentColor;
}

.menu-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #ef4444;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.header-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.header-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.header-menu-item:hover,
.header-menu-item:focus-visible {
  background: rgba(56, 189, 248, 0.12);
  outline: none;
}

.header-menu-item--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-menu-item-text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.menu-item-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: #ef4444;
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}

.menu-item-badge.hidden {
  display: none;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
  color: #f8fafc;
  text-shadow: 0 10px 30px rgba(59, 130, 246, 0.25);
}

.logo {
  display: block;
  margin: 0 auto;
  width: min(250px, 43vw);
}

.logo-home-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: none;
  font: inherit;
  color: inherit;
}

.logo-home-btn:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.7);
  outline-offset: 4px;
}

.logo-home-btn:hover .logo-image {
  filter: brightness(1.06);
}

.logo-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  pointer-events: none;
}

.subtitle {
  margin-top: 6px;
  color: #cbd5e1;
  letter-spacing: 0.03em;
  font-style: italic;
}

.card {
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.62), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  padding: 18px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  margin-bottom: 16px;
  animation: cardIn 280ms ease;
}

#auth-section {
  max-width: 520px;
  margin: 0 auto 16px;
}

#auth-section.login-mode:not(.hidden) {
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.36), rgba(2, 6, 23, 0.5)),
    url("/assets/login-background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 640px;
  display: grid;
  align-content: start;
  padding-top: 34px;
  padding-bottom: 28px;
}

#game-section {
  position: relative;
  background:
    linear-gradient(180deg, rgba(7, 25, 52, 0.52), rgba(6, 19, 42, 0.5)),
    url("/assets/game-background.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

#game-section.card {
  padding-top: 10px;
}

#dashboard-section {
  --dashboard-action-width: 164px;
  --dashboard-metrics-width: 315px;
  --dashboard-row-gap: 12px;
  --dashboard-card-width: 620px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 16px;
}

#dashboard-section.card {
  padding: 10px;
}

#dashboard-section.dashboard-view {
  width: min(100%, calc(var(--dashboard-card-width) + 24px));
  max-width: calc(var(--dashboard-card-width) + 24px);
}

#dashboard-section.dashboard-view.profile-view {
  width: min(100%, 860px);
  max-width: 860px;
}

#dashboard-section.dashboard-view.profile-view.card {
  padding: 8px;
}

.auth-shell {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.auth-title {
  margin: 2px 0 4px;
}

.auth-form {
  width: 100%;
  max-width: 340px;
  display: grid;
  gap: 8px;
}

#auth-section.login-mode .auth-form {
  max-width: 220px;
  gap: 10px;
  margin-top: 18px;
}

#auth-section.login-mode .auth-shell {
  width: min(100%, 760px);
  justify-self: center;
}

.auth-form label {
  margin-bottom: 2px;
}

.auth-form input {
  height: 40px;
  padding: 8px 10px;
}

.auth-btn {
  margin-top: 8px;
  height: 40px;
}

.auth-btn.image-auth-btn {
  width: auto;
  min-width: 0;
  height: auto;
  justify-self: center;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}

.auth-btn.image-auth-btn:hover {
  transform: none;
  filter: none;
}

.auth-btn-image {
  display: block;
  width: 130px;
  max-width: 80vw;
  height: auto;
}

.auth-btn-image--create {
  width: 150px;
}

.auth-btn.login-image-btn {
  border-radius: 0;
  color: transparent;
}

.auth-btn.login-image-btn:hover {
  filter: brightness(1.04);
}

.auth-btn.create-profile-image-btn {
  border-radius: 0;
  color: transparent;
  background: transparent !important;
}

.auth-btn.create-profile-image-btn:hover {
  filter: brightness(1.04);
  background: transparent !important;
}

.auth-toggle {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
}

.auth-toggle a {
  color: #93c5fd;
  text-decoration: none;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

.auth-profile-privacy-hint {
  text-align: left;
  line-height: 1.45;
  max-width: 100%;
}

/* Match form <label> typography (see global `label`); profile page keeps bold `.profile-privacy-public-label`. */
.auth-form .auth-profile-privacy-row .auth-profile-public-label {
  font-weight: 600;
  color: #cbd5e1;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.auth-form .auth-profile-privacy-row {
  margin-top: 0;
}

.ios-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cbd5e1;
}

.ios-toggle {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
}

.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(100, 116, 139, 0.8);
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.ios-toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.ios-toggle input:checked + .ios-toggle-slider {
  background: #34c759;
}

.ios-toggle input:checked + .ios-toggle-slider::before {
  transform: translateX(18px);
}

.hidden {
  display: none;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row > * {
  flex: 1 1 200px;
}

.dashboard-header {
  align-items: center;
  justify-content: space-between;
}

.dashboard-header > * {
  flex: 0 0 auto;
}

.dashboard-header-title {
  flex: 1 1 auto;
}

.dashboard-header-actions {
  display: flex;
  justify-content: flex-end;
}

.dashboard-header-actions.profile-actions {
  gap: 8px;
}

.dashboard-header-actions.profile-actions > .compact-btn + .compact-btn {
  margin-left: 8px;
}

#profile-request-friend-btn,
#profile-logout-btn {
  text-transform: uppercase;
}

.logout-icon {
  display: none;
}

.game-header {
  align-items: flex-start;
  gap: 12px;
}

#game-section .game-header {
  margin-top: 0;
  flex-wrap: nowrap;
  align-items: flex-start;
}

#game-section h2 {
  margin: 0 0 2px;
}

.game-header > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.game-header-meta-time {
  flex: 0 0 auto;
  align-self: flex-start;
  text-align: right;
  opacity: 0.88;
  font-size: 12px;
  line-height: 1.35;
  color: #cbd5e1;
  max-width: 48%;
}

.game-header-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #cbd5e1;
  font-size: 13px;
  letter-spacing: 0.02em;
}

input,
select,
button {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

input,
select {
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
  transform: translateY(-1px);
}

button {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  border: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, filter 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  white-space: nowrap;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  background: linear-gradient(135deg, #334155, #475569);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.35);
}

button.warn {
  background: linear-gradient(135deg, #dc2626, #be123c);
  box-shadow: 0 8px 20px rgba(190, 24, 93, 0.3);
}

button:disabled {
  background: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.compact-btn {
  width: auto;
  min-width: 0;
  padding: 8px 12px;
  height: 36px;
  font-size: 13px;
  line-height: 1;
}

.cta-generate-btn {
  height: 42px;
  min-width: 176px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  box-shadow:
    0 10px 22px rgba(14, 165, 233, 0.4),
    0 0 0 1px rgba(125, 211, 252, 0.35) inset;
}

#dashboard-section #logout-btn,
#dashboard-section .resume-btn {
  text-transform: uppercase;
}

#dashboard-section #logout-btn,
#dashboard-section #new-game-btn,
#dashboard-section #open-leaderboard-btn.leaderboard-open-cta,
#dashboard-section .resume-btn {
  width: var(--dashboard-action-width);
  min-width: var(--dashboard-action-width);
  max-width: var(--dashboard-action-width);
  text-align: center;
}

#dashboard-section .resume-btn {
  width: auto;
  min-width: 0;
  max-width: none;
  margin-left: auto;
  padding-left: 10px;
  padding-right: 10px;
}

#dashboard-section #new-game-btn {
  flex: 0 0 auto;
  box-sizing: border-box;
}

#dashboard-section #open-leaderboard-btn.leaderboard-open-cta {
  flex: 0 0 auto;
  height: 42px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  box-sizing: border-box;
  color: #f8fafc;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow:
    0 8px 20px rgba(99, 102, 241, 0.38),
    0 0 0 1px rgba(196, 181, 253, 0.35) inset;
}

#dashboard-section #open-leaderboard-btn.leaderboard-open-cta:hover {
  filter: brightness(1.07) saturate(1.05);
}

#dashboard-section .resume-btn {
  flex: 0 0 auto;
}

.cta-generate-btn:hover {
  filter: brightness(1.08) saturate(1.04);
}

.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.42);
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 10px;
}

.success {
  color: #dcfce7;
  background: rgba(6, 78, 59, 0.4);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.stat {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat .value {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.15;
}

#game-section .stats-grid--game {
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

#game-section .stats-grid--game .stat {
  padding: 6px 6px;
  border-radius: 10px;
}

#game-section .stats-grid--game .stat > div:first-child {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#game-section .stats-grid--game .stat .value {
  font-size: 0.86rem;
  font-weight: 800;
}

#game-section .stats-grid--game .stat > div:not(:first-child):not(.value) {
  font-size: 9px;
  color: #94a3b8;
  margin-top: 1px;
}

.games-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.game-item {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dashboard-section {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
}

#dashboard-section.dashboard-view .dashboard-section {
  width: min(100%, var(--dashboard-card-width));
  margin-left: auto;
  margin-right: auto;
}

#dashboard-section.dashboard-view.profile-view .dashboard-section {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  padding: 10px;
  border-radius: 12px;
}

#dashboard-section.dashboard-view.profile-view .dashboard-header {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 8px;
}

#dashboard-section.dashboard-view.friends-view .dashboard-section {
  width: 100%;
  max-width: 100%;
}

.friends-shell {
  display: grid;
  gap: 14px;
}

.friends-section {
  min-width: 0;
}

.friends-section--search {
  display: grid;
  gap: 8px;
}

.friends-section--search input[type="search"] {
  max-width: 420px;
}

#dashboard-section.dashboard-view.friends-view .friends-shell h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.friends-search-hint {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.friends-search-results {
  min-height: 0;
}

.friends-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.friends-search-row:last-child {
  border-bottom: none;
}

.friends-search-name {
  font-weight: 600;
  color: #e2e8f0;
}

.friends-search-status {
  font-size: 13px;
  color: #94a3b8;
}

.friends-search-empty {
  margin: 6px 0 0;
  font-size: 13px;
  color: #94a3b8;
}

.dashboard-section h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.profile-shell {
  display: grid;
  gap: 10px;
}

.profile-shell > * {
  min-width: 0;
}

.profile-meta-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.profile-meta-item {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.48);
  min-width: 0;
}

.profile-meta-item .meta-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-meta-item .meta-value {
  margin-top: 3px;
  font-weight: 700;
  color: #f8fafc;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.profile-privacy-toggle-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-privacy-public-label {
  font-weight: 700;
  color: #f8fafc;
}

.profile-tabs {
  display: flex;
  gap: 6px;
}

.profile-tab-btn {
  width: auto;
  min-width: 0;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.95);
}

.profile-tab-btn.active {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.profile-friends-list {
  display: grid;
  gap: 6px;
}

.profile-friend-row {
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.5);
}

.profile-link {
  color: #bfdbfe;
  text-decoration: none;
  font-weight: 700;
}

.profile-link:hover {
  text-decoration: underline;
}

.coop-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #082f49;
  background: linear-gradient(135deg, #22d3ee, #67e8f9);
  border: 1px solid rgba(125, 211, 252, 0.6);
  vertical-align: middle;
  cursor: help;
}

.request-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
}

.request-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 12px;
}

.request-table th,
.request-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
}

.request-table tr:last-child td {
  border-bottom: none;
}

.request-action-btn {
  width: auto;
  min-width: 0;
  padding: 5px 9px;
  font-size: 11px;
  margin-right: 6px;
}

.leaderboard-row {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.leaderboard-row > h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.leaderboard-row > #open-leaderboard-btn {
  flex: 0 0 auto;
}

.leaderboard-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
}

.profile-shell .leaderboard-table-wrap,
.profile-shell .request-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.profile-shell .leaderboard-table {
  min-width: 0;
  table-layout: fixed;
}

.profile-shell .leaderboard-table th,
.profile-shell .leaderboard-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#dashboard-section .profile-shell table.coop-games-table th:first-child,
#dashboard-section .profile-shell table.coop-games-table td:first-child {
  min-width: 120px;
  width: auto;
  white-space: nowrap;
}

#dashboard-section .profile-shell table.coop-games-table th:nth-child(2),
#dashboard-section .profile-shell table.coop-games-table td:nth-child(2) {
  min-width: 145px;
  width: auto;
  white-space: nowrap;
}

#dashboard-section .profile-shell table.coop-games-table th:nth-child(3),
#dashboard-section .profile-shell table.coop-games-table td:nth-child(3) {
  min-width: 96px;
  width: auto;
  white-space: nowrap;
}

#dashboard-section .profile-shell table.coop-games-table th:nth-child(4),
#dashboard-section .profile-shell table.coop-games-table td:nth-child(4) {
  min-width: 92px;
  width: auto;
  white-space: nowrap;
}

#dashboard-section .profile-shell table.coop-games-table th:nth-child(5),
#dashboard-section .profile-shell table.coop-games-table td:nth-child(5) {
  min-width: 120px;
  width: auto;
  white-space: normal;
}

#dashboard-section .profile-shell table.coop-games-table th:nth-child(7),
#dashboard-section .profile-shell table.coop-games-table td:nth-child(7) {
  min-width: 1%;
  width: 1%;
  white-space: nowrap;
  text-align: center;
  padding-right: 4px;
  padding-left: 4px;
}

#dashboard-section .profile-shell table.coop-games-table {
  table-layout: auto;
  width: 100%;
  min-width: 100%;
}

#dashboard-section .profile-shell table.coop-games-table th,
#dashboard-section .profile-shell table.coop-games-table td {
  padding: 5px 7px;
}

#dashboard-section .profile-shell .profile-coop-resume-btn {
  height: 28px;
  padding: 2px 10px;
  font-size: 11px;
  line-height: 1;
}

#dashboard-section .profile-shell table.leaderboard-table th:last-child,
#dashboard-section .profile-shell table.leaderboard-table td:last-child {
  min-width: 130px;
  white-space: normal;
}

#dashboard-section .profile-shell .updated-cell .updated-date,
#dashboard-section .profile-shell .updated-cell .updated-time {
  display: block;
  white-space: nowrap;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 12px;
}

.leaderboard-table .lb-resume-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
}

.leaderboard-table .lb-resume-placeholder {
  color: #64748b;
}

.leaderboard-table .lb-resume-btn {
  min-width: 0;
  width: auto;
  padding: 2px 12px;
  height: 28px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
}

.leaderboard-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.65);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-meta {
  margin: 0 0 10px;
  font-size: 12px;
  color: #94a3b8;
}

.leaderboard-filters-section {
  margin-top: 10px;
}

.leaderboard-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.leaderboard-filter-row > div {
  flex: 1 1 160px;
  min-width: 0;
}

.lb-rank-cell {
  width: 44px;
  text-align: center;
  vertical-align: middle;
}

.lb-medal {
  font-size: 1.15rem;
  line-height: 1;
}

.lb-rank-num {
  font-weight: 700;
  color: #94a3b8;
  font-size: 13px;
}

.leaderboard-tr-top3 td {
  background: rgba(56, 189, 248, 0.06);
}

.leaderboard-tr-top3:hover td {
  background: rgba(56, 189, 248, 0.1);
}

.new-game-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

#dashboard-section .new-game-row,
#dashboard-section .stats-dashboard-row {
  align-items: flex-end;
}

#dashboard-section .new-game-row > .new-game-actions,
#dashboard-section .stats-dashboard-row > .new-game-actions {
  flex: 0 0 var(--dashboard-action-width);
  width: var(--dashboard-action-width);
  max-width: var(--dashboard-action-width);
  min-width: var(--dashboard-action-width);
  box-sizing: border-box;
}

#dashboard-section .new-game-row > div:not(.new-game-actions) {
  flex: 0 0 calc(var(--dashboard-metrics-width) / 2);
  max-width: calc(var(--dashboard-metrics-width) / 2);
}

#dashboard-section .new-game-row,
#dashboard-section .stats-dashboard-row {
  gap: var(--dashboard-row-gap);
  justify-content: flex-start;
}

#dashboard-section .new-game-row > .new-game-actions,
#dashboard-section .stats-dashboard-row > .new-game-actions {
  margin-left: auto;
}

#dashboard-section .stats-dashboard-row > .stats-dashboard-metrics {
  flex: 0 0 var(--dashboard-metrics-width);
  max-width: var(--dashboard-metrics-width);
  min-width: 0;
}

#dashboard-section.dashboard-view .dashboard-header {
  max-width: var(--dashboard-card-width);
  margin-left: auto;
  margin-right: auto;
}

#dashboard-section .stats-grid--dashboard-compact {
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: var(--dashboard-metrics-width);
  width: 100%;
}

#dashboard-section .stats-grid--dashboard-compact .stat {
  min-height: 40px;
  padding: 4px 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

#dashboard-section .stats-grid--dashboard-compact .stat > div:first-child {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#dashboard-section .stats-grid--dashboard-compact .stat .value {
  font-size: 15px;
  line-height: 1;
}

.game-item-meta-inline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-item-meta-time {
  opacity: 0.88;
  font-size: 12px;
}

.section-stats {
  border-left: 4px solid rgba(56, 189, 248, 0.9);
}

.section-new-game {
  border-left: 4px solid rgba(34, 197, 94, 0.9);
}

.section-games {
  border-left: 4px solid rgba(250, 204, 21, 0.9);
}

.section-dictionary {
  border-left: 4px solid rgba(168, 85, 247, 0.9);
}

details.dashboard-collapsible > summary.dashboard-collapsible-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
}

details.dashboard-collapsible > summary.dashboard-collapsible-summary::-webkit-details-marker {
  display: none;
}

details.dashboard-collapsible > summary.dashboard-collapsible-summary::before {
  content: "▶";
  display: inline-block;
  flex-shrink: 0;
  font-size: 0.55em;
  color: #94a3b8;
  line-height: 1;
  transition: transform 0.15s ease;
}

details.dashboard-collapsible[open] > summary.dashboard-collapsible-summary::before {
  transform: rotate(90deg);
}

details.dashboard-collapsible .dashboard-collapsible-heading {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
}

.dashboard-collapsible-panel {
  margin-top: 12px;
  padding-top: 2px;
}

details.dashboard-collapsible:not([open]) > summary.dashboard-collapsible-summary {
  margin-bottom: 0;
}

.ring-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 18px auto 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%),
    radial-gradient(circle at center, rgba(19, 49, 85, 0.86) 0 58%, rgba(7, 15, 35, 0) 58%);
  box-shadow:
    inset 0 20px 26px rgba(255, 255, 255, 0.08),
    inset 0 -24px 28px rgba(2, 6, 23, 0.5),
    0 22px 30px rgba(2, 6, 23, 0.38);
}

.letter {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 34px;
  font-weight: 700;
  color: #111827;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0) 44%),
    linear-gradient(180deg, #fff5a9 0%, #f7d34f 56%, #e7b931 100%);
  border: 2px solid rgba(151, 109, 15, 0.9);
  box-shadow:
    0 5px 0 rgba(130, 95, 17, 0.95),
    0 12px 18px rgba(0, 0, 0, 0.34),
    inset 0 2px 0 rgba(255, 255, 255, 0.75),
    inset 0 -6px 10px rgba(186, 132, 24, 0.4);
  user-select: none;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

.letter:hover {
  transform: translate(-50%, -50%) scale(1.04);
  filter: saturate(1.08) brightness(1.02);
  box-shadow:
    0 6px 0 rgba(130, 95, 17, 0.95),
    0 14px 22px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.82),
    inset 0 -6px 10px rgba(186, 132, 24, 0.38);
}

.ring-letter,
.letter.center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.letter.center {
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 44%),
    linear-gradient(180deg, #48e0c2 0%, #21c6b0 56%, #11a9a0 100%);
  border-color: rgba(10, 117, 104, 0.95);
  color: #fff;
  box-shadow:
    0 5px 0 rgba(6, 113, 103, 0.95),
    0 12px 24px rgba(10, 139, 128, 0.52),
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -6px 10px rgba(5, 110, 103, 0.38);
}

.found-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: rgba(51, 65, 85, 0.72);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pangram-chip {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(45, 212, 191, 0.35));
  border-color: rgba(251, 191, 36, 0.9);
  color: #fefce8;
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.35),
    0 8px 20px rgba(45, 212, 191, 0.2);
}

.mini-report-btn {
  width: auto;
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #b91c1c, #9f1239);
  box-shadow: none;
}

.tools-menu {
  width: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tools-menu > summary {
  list-style: none;
  background: linear-gradient(135deg, #334155, #0f766e);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  width: 46px;
  min-width: 46px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.tools-menu > summary::-webkit-details-marker {
  display: none;
}

.tools-panel {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  min-width: 260px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 20px 30px rgba(2, 8, 23, 0.5);
}

.mobile-panel {
  margin-top: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  padding: 6px 8px;
}

.mobile-panel > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
}

.mobile-panel > summary::-webkit-details-marker {
  display: none;
}

.game-controls {
  align-items: flex-start;
  gap: 8px;
}

.game-header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-left: auto;
  align-self: flex-start;
  flex: 0 0 auto;
}

#game-section .game-header .game-header-meta-time {
  max-width: none;
  width: auto;
  text-align: right;
  align-self: flex-end;
}

#share-game-core-btn.share-game-top-btn {
  width: auto;
  min-width: 0;
  height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.share-game-modal {
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(7, 25, 52, 0.82);
  display: grid;
  gap: 12px;
  justify-items: center;
  width: max-content;
  max-width: min(92vw, 400px);
}

.share-game-overlay {
  position: absolute;
  left: 50%;
  top: 57%;
  transform: translate(-50%, -50%);
  z-index: 40;
  pointer-events: none;
}

.share-game-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: rgba(2, 6, 23, 0.18);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.share-game-overlay .share-game-modal {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.share-game-modal-title {
  font-weight: 700;
  color: #e2e8f0;
  font-size: 18px;
}

.share-game-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.share-mode-toggle {
  position: relative;
  width: 272px;
  max-width: 100%;
  height: 40px;
  display: block;
}

.share-mode-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.share-mode-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.share-mode-track::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 8px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.35);
  transition: transform 0.18s ease;
}

.share-mode-toggle input:checked + .share-mode-track::before {
  transform: translateX(calc(100% + 8px));
}

.share-mode-label-left,
.share-mode-label-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 700;
  color: #cbd5e1;
  pointer-events: none;
  width: 50%;
  text-align: center;
}

.share-mode-label-left {
  left: 0;
}

.share-mode-label-right {
  right: 0;
}

#copy-share-link-btn {
  width: auto;
  min-width: 120px;
  height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  text-transform: uppercase;
}

.share-copied-toast {
  margin-top: 6px;
}

.game-controls > * {
  flex: 1 1 100%;
}

.game-controls .word-entry {
  flex: 1 1 100%;
  min-width: 0;
}

.ctrl-btn {
  width: 46px;
  min-width: 46px;
  padding: 8px 0;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.icon-only-btn,
.tools-menu > summary.icon-only-trigger {
  width: 56px;
  min-width: 56px;
  height: 56px;
  padding: 7px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(7, 25, 52, 0.72), rgba(7, 25, 52, 0.56));
  box-shadow:
    0 8px 16px rgba(2, 8, 23, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  line-height: 0;
  vertical-align: middle;
}

.tools-menu > summary.icon-only-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-only-btn:hover,
.tools-menu > summary.icon-only-trigger:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.icon-only-btn:hover .btn-icon,
.tools-menu > summary.icon-only-trigger:hover .btn-icon {
  transform: scale(1.04);
  filter: saturate(1.03);
}

.icon-only-btn:active .btn-icon,
.tools-menu > summary.icon-only-trigger:active .btn-icon {
  transform: scale(0.98);
}

.mobile-word-display {
  min-height: 42px;
  border: 1px solid rgba(59, 130, 246, 0.55);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  padding: 8px 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.entry-letter {
  display: inline-block;
}

.entry-letter.valid {
  color: #f8fafc;
}

.entry-letter.invalid {
  color: #94a3b8;
}

.controls-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

#game-section .game-word-row {
  margin-bottom: 2px;
}

#game-section .ring-container {
  margin: 10px auto 18px;
}

#game-section .game-actions-row .controls-row {
  margin-top: 6px;
}

/* Game control strip: icon buttons + “more” trigger (~25% larger than base icon-only sizing) */
#game-section .icon-only-btn,
#game-section .tools-menu > summary.icon-only-trigger {
  width: 70px;
  min-width: 70px;
  height: 70px;
  padding: 9px;
  border-radius: 15px;
}

#game-section .btn-icon {
  width: 47.5px;
  height: 47.5px;
}

.back-icon-btn {
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
}

.rules-line {
  white-space: normal;
  overflow: visible;
  scrollbar-width: auto;
  word-break: break-word;
}

.rules-line::-webkit-scrollbar {
  height: 4px;
}

.fx-pop,
.fx-splash {
  position: fixed;
  left: 120px;
  top: 120px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
}

.fx-pop {
  font-size: 34px;
  color: #86efac;
  text-shadow: 0 0 18px rgba(134, 239, 172, 0.7);
  animation: popUp 650ms ease forwards;
}

.fx-splash {
  font-size: 24px;
  font-weight: 800;
  color: #fef3c7;
  text-shadow:
    0 0 16px rgba(251, 191, 36, 0.6),
    0 0 24px rgba(45, 212, 191, 0.75);
  animation: splash 1500ms ease forwards;
}

#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

h2,
h3 {
  color: #f8fafc;
}

p {
  color: #cbd5e1;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popUp {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(8px) scale(0.8);
  }
  45% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-8px) scale(1.12);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-24px) scale(1);
  }
}

@keyframes splash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(8px) scale(0.85);
  }
  30% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-4px) scale(1.03);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(-16px) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-30px) scale(1.08);
  }
}

@media (max-width: 700px) {
  .ring-container {
    width: 280px;
    height: 280px;
  }

  .letter {
    width: 70px;
    height: 70px;
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 12px 10px 18px;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  #auth-section.login-mode {
    min-height: 560px;
    padding-top: 22px;
  }

  #auth-section.login-mode .auth-form {
    max-width: 220px;
  }

  #dashboard-section {
    max-width: none;
    width: 100%;
  }

  #dashboard-section.card {
    padding: 8px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat {
    padding: 10px;
  }

  .stat .value {
    font-size: 18px;
  }

  .game-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-item button {
    width: auto;
  }

  .game-controls {
    display: block;
  }

  .tools-panel {
    min-width: 0;
  }
}

@media (max-width: 430px) {
  #dashboard-section {
    --dashboard-action-width: 152px;
    --dashboard-metrics-width: 100%;
    --dashboard-card-width: 100%;
  }

  body.mobile-game-mode {
    overflow: hidden;
  }

  body.mobile-game-mode .container {
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 6px;
  }

  body.mobile-game-mode #game-section {
    height: calc(100dvh - 88px);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-game-mode #game-section > * {
    min-height: 0;
  }

  /* Keep core play UI from shrinking over each other in the flex column */
  body.mobile-game-mode #game-section > .game-header,
  body.mobile-game-mode #game-section > .stats-grid--game,
  body.mobile-game-mode #game-section > .game-word-row,
  body.mobile-game-mode #game-section > .ring-container,
  body.mobile-game-mode #game-section > .game-actions-row,
  body.mobile-game-mode #game-section > .error,
  body.mobile-game-mode #game-section > .success {
    flex-shrink: 0;
    min-height: unset;
  }

  body {
    font-size: 13px;
  }

  header {
    --header-card-width: 100%;
    margin-bottom: 8px;
  }

  .settings-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .container {
    padding: 6px 6px 10px;
  }

  .card {
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 8px;
  }

  #auth-section.login-mode {
    min-height: 520px;
    padding-top: 14px;
    padding-bottom: 16px;
  }

  #auth-section.login-mode .auth-form {
    max-width: 200px;
    gap: 8px;
  }

  .auth-btn-image {
    width: 105px;
  }

  .auth-btn-image--create {
    width: 118px;
  }

  #game-section.card {
    padding-top: 4px;
  }

  #dashboard-section.card {
    padding: 6px;
  }

  h1 {
    font-size: 1.55rem;
  }

  .logo {
    width: min(180px, 46vw);
  }

  .subtitle {
    font-size: 11px;
    margin-top: 2px;
  }

  .row {
    gap: 6px;
  }

  .row > * {
    flex: 1 1 100%;
  }

  input,
  select,
  button {
    font-size: 16px;
    padding: 8px 10px;
  }

  .dashboard-header {
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
  }

  .dashboard-header-title {
    min-width: 0;
    flex: 1 1 auto;
  }

  .dashboard-header-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }

  #dashboard-section .dashboard-header-actions #logout-btn {
    height: 36px;
    font-size: 12px;
    box-sizing: border-box;
  }

  .dashboard-section {
    margin-top: 6px;
    padding: 6px;
    border-radius: 10px;
  }

  .leaderboard-row {
    gap: 6px;
    align-items: center;
  }

  .leaderboard-row > h3 {
    flex: 1 1 auto;
    min-width: 0;
  }

  .leaderboard-row .compact-btn:not(.leaderboard-open-cta) {
    height: 30px;
    padding: 6px 8px;
    font-size: 11px;
  }

  #dashboard-section #open-leaderboard-btn.leaderboard-open-cta {
    flex: 0 0 auto;
    width: var(--dashboard-action-width);
    max-width: var(--dashboard-action-width);
    min-width: var(--dashboard-action-width);
    height: 36px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1;
    box-sizing: border-box;
  }

  .leaderboard-table {
    min-width: 560px;
    font-size: 12px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 6px 8px;
  }

  .stats-grid {
    gap: 6px;
    margin: 6px 0;
  }

  #dashboard-section .stats-grid--dashboard-compact {
    max-width: none;
    width: 100%;
    gap: 6px;
  }

  #dashboard-section .stats-dashboard-row > .stats-dashboard-metrics {
    flex: 1 1 100%;
  }

  #dashboard-section .new-game-row > .new-game-actions,
  #dashboard-section .stats-dashboard-row > .new-game-actions {
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-content: center;
    margin-top: 2px;
  }

  .stat {
    padding: 6px;
    border-radius: 10px;
  }

  .stat .value {
    font-size: 0.98rem;
    line-height: 1.1;
  }

  #dashboard-section .stats-grid--dashboard-compact .stat > div:first-child {
    font-size: 10px;
  }

  #dashboard-section .new-game-row {
    gap: 6px;
    align-items: end;
  }

  #dashboard-section .new-game-row > div,
  #dashboard-section .new-game-row > div:not(.new-game-actions) {
    flex: 1 1 calc(50% - 3px);
    max-width: none;
  }

  #dashboard-section .new-game-row label {
    font-size: 12px;
    margin-bottom: 4px;
  }

  #dashboard-section .new-game-row select {
    height: 36px;
    font-size: 14px;
    padding: 6px 9px;
  }

  #dashboard-section #new-game-btn {
    flex: 0 0 auto;
    width: var(--dashboard-action-width);
    max-width: var(--dashboard-action-width);
    min-width: var(--dashboard-action-width);
    height: 36px;
    font-size: 12px;
    box-sizing: border-box;
  }

  .leaderboard-filter-row {
    gap: 8px;
  }

  .leaderboard-filter-row select {
    height: 36px;
    font-size: 14px;
    padding: 6px 9px;
  }

  .game-item {
    padding: 7px;
    border-radius: 10px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .game-item .compact-btn {
    height: 38px;
    padding: 6px 8px;
    font-size: 12px;
    align-self: stretch;
  }

  #dashboard-section .game-item .resume-btn {
    width: auto;
    min-width: 0;
    max-width: none;
    margin-left: auto;
  }

  .game-item > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  .game-item-meta-inline {
    font-size: 12px;
  }

  .game-item-meta-time {
    font-size: 11px;
  }

  #game-section h2 {
    font-size: 1.15rem;
    margin: 0 0 1px;
    line-height: 1.15;
    white-space: nowrap;
  }

  #game-section .game-header {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: flex-start;
  }

  #game-section .game-header > :first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  #game-section .game-header-meta-time {
    font-size: 10px;
    max-width: none;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 0;
  }

  #game-section .stats-grid--game {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 5px 0 10px;
  }

  #game-section .stats-grid--game .stat {
    padding: 4px 3px;
    border-radius: 8px;
  }

  #game-section .stats-grid--game .stat .value {
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
  }

  #game-section .stats-grid--game .stat > div:first-child {
    color: #94a3b8;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
  }

  #game-section .stats-grid--game .stat > div:not(:first-child):not(.value) {
    font-size: 8px;
    line-height: 1;
    margin-top: 1px;
  }

  .rules-line {
    font-size: 11px;
    margin: 2px 0 4px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }

  #game-section .game-word-row {
    margin-top: 2px;
    margin-bottom: 16px;
  }

  #game-section .ring-container {
    width: 206px;
    height: 206px;
    margin: 12px auto 10px;
  }

  #game-section .letter {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 26px;
    font-weight: 800;
  }

  #game-section .game-controls {
    display: block;
  }

  #game-section .controls-row {
    gap: 8px;
    margin-top: 4px;
  }

  #game-section .ctrl-btn {
    width: 62.5px;
    min-width: 62.5px;
    height: 62.5px;
    padding: 0;
  }

  #game-section .tools-menu > summary.icon-only-trigger {
    width: 62.5px;
    min-width: 62.5px;
    height: 62.5px;
    padding: 0;
  }

  #game-section .btn-icon {
    width: 45px;
    height: 45px;
  }

  #game-section .mobile-word-display {
    min-height: 40px;
    font-size: 21px;
    padding: 6px 8px;
  }

  #game-section .tools-panel {
    padding: 8px;
    gap: 6px;
  }

  #game-section .tools-panel input {
    height: 32px;
    font-size: 16px;
  }

  .found-words {
    gap: 6px;
  }

  .chip {
    font-size: 10px;
    padding: 3px 7px;
  }

  .mini-report-btn {
    padding: 2px 6px;
    font-size: 10px;
  }

  .fx-pop {
    font-size: 22px;
  }

  .fx-splash {
    font-size: 15px;
  }
}
