@font-face {
  font-family: Cubao;
  src: url("fonts/cubao-free/Cubao_Free_Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #16202c;
  --muted: #647386;
  --line: #d9e0e8;
  --electric-blue: #1930ad;
  --soft-gold: #fff1bd;
  --gold-bar: #f4d36b;
  --accent: var(--electric-blue);
  --accent-dark: #102080;
  --ok: #0e8a55;
  --danger: #b42318;
  --warm: #f5b041;
  --profile-column-height: 622px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.landing-title,
.dashboard-title,
.profile-yams-link {
  font-family: Cubao, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
}

.yams-word {
  display: inline-flex;
  align-items: baseline;
  height: 1em;
  color: inherit;
  line-height: 1;
}

.yams-word-m {
  margin-right: -.1em;
  font-size: 1em;
  line-height: 1;
}

.yams-word-y {
  font-size: 1.55em;
  line-height: 1;
}

.yams-word-rest {
  margin-left: -.18em;
  line-height: 1;
}

.landing-title .yams-word,
.dashboard-title .yams-word {
  height: .82em;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 800;
  font-size: 22px;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 650;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eaf6ef;
  color: var(--ok);
  font-size: 12px;
  font-weight: 850;
}

.page {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  align-items: center;
  gap: 48px;
}

.hero h1,
.toolbar h1,
.auth-card h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .98;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.hero .hero-kicker {
  margin: 12px 0 18px;
}

.hero-actions {
  justify-content: flex-start;
  gap: 8px;
}

.page:has(.landing-hero) {
  min-height: 100svh;
  padding: 28px 0 24px;
}

.landing-hero {
  min-height: calc(100svh - 137px);
  display: block;
}

.landing-content {
  display: grid;
  justify-items: center;
  gap: clamp(28px, 5.4vh, 46px);
  padding-top: 34px;
  text-align: center;
}

.landing-hero .landing-title {
  margin: 0;
  position: relative;
  color: var(--electric-blue);
  font-size: clamp(150px, 20.5vw, 264px);
  line-height: .82;
  letter-spacing: 0;
  transform: translateY(50px);
}

.landing-kicker {
  margin: 0;
  text-align: center;
}

.landing-hero .landing-subtitle {
  justify-self: center;
  box-sizing: border-box;
  width: min(72vw, 1120px);
  margin: -60px 0 8px;
  padding-left: calc(clamp(0px, 3.2vw, 56px) - 25pt);
  color: var(--electric-blue);
  font-size: clamp(30px, 3.4vw, 45px);
  font-weight: 750;
  line-height: 1.15;
  text-align: left;
  transform: translate(-123px, 50px);
}

.landing-hero .landing-actions {
  justify-content: center;
  gap: 50px;
  margin: 0;
  transform: translateY(calc(30pt + 35px));
}

.button.landing-register-button,
.button.landing-login-button {
  min-height: 58px;
  padding: 0 24px;
  border-radius: 26px;
  min-width: 250px;
  color: #111827;
  font-size: 22px;
  font-weight: 850;
  gap: 12px;
}

.button.landing-register-button svg,
.button.landing-login-button svg {
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button.landing-register-button {
  border-color: rgba(125, 135, 146, .34);
  background: #e9edf2;
}

.button.landing-register-button:hover {
  filter: saturate(1.04) contrast(1.03);
  color: var(--electric-blue);
}

.button.landing-login-button {
  border-color: rgba(184, 137, 0, .28);
  background: var(--soft-gold);
}

.button.landing-login-button:hover {
  filter: saturate(1.04) contrast(1.03);
  color: var(--electric-blue);
}

.landing-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  text-align: center;
}

.landing-dice-panel {
  width: min(620px, 100%);
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
}

.dice-panel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 28px;
  background: #202b38;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(23, 35, 50, .22);
}

.dice-panel span {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: #fff;
  color: #202b38;
  border-radius: 8px;
  font-size: clamp(34px, 5vw, 74px);
  line-height: 1;
  padding-bottom: .08em;
}

.actions,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(31, 43, 58, .08);
}

.button.primary,
button.primary {
  border-color: var(--accent);
  background: linear-gradient(135deg, #eef7ff 0%, #1930ad 48%, #102080 100%);
  color: #fff;
}

.button.primary:hover,
button.primary:hover {
  filter: saturate(1.08) contrast(1.03);
  color: #fff;
}

.danger-button {
  border-color: #f0b8b1;
  background: #fff0ee;
  color: var(--danger);
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.auth-card,
.stats-panel,
.dashboard-block,
.scoreboard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.app-shell {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, .9fr) minmax(0, 2fr);
  grid-template-rows: 185px 479px;
  grid-template-areas:
    "profile title actions"
    "ranking quick latest";
  gap: 18px 24px;
  align-items: stretch;
}

.dashboard-block {
  min-width: 0;
  padding: 20px;
}

.clickable-block {
  cursor: pointer;
}

.home-profile-block {
  grid-area: profile;
  display: grid;
  grid-template-columns: 101px 1fr;
  align-items: center;
  align-self: start;
  gap: 18px;
  min-width: 0;
  transform: translate(18px, 39px);
}

.home-profile-block h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
}

.home-profile-block:hover h1 {
  color: var(--electric-blue);
}

.home-profile-block p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.home-profile-block .avatar-large {
  width: 101px;
  height: 101px;
}

.avatar-large,
.avatar-profile {
  width: 112px;
  height: 112px;
  border-radius: 8px;
  object-fit: cover;
  background: #eaf2fb;
}

.avatar-profile {
  width: 158px;
  height: 158px;
  margin-bottom: 6px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(380px, .43fr) minmax(0, .57fr);
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}

.profile-toolbar {
  justify-content: flex-start;
  margin-bottom: 0;
}

.profile-yams-link {
  display: inline-block;
  min-height: 42px;
  margin-left: 18px;
  border: 0;
  color: var(--electric-blue);
  font-size: 47px;
  line-height: 1;
  letter-spacing: 0;
}

.profile-summary {
  min-height: 294px;
  position: relative;
}

.profile-summary.profile-blue {
  --profile-rank-color: var(--accent-dark);
  background: rgba(25, 48, 173, .18);
  border-color: rgba(25, 48, 173, .34);
  box-shadow: inset 6px 0 0 rgba(25, 48, 173, .50), 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.profile-info-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.profile-info-heading span {
  color: var(--accent);
  font-size: 15px;
  font-weight: 750;
}

.profile-summary-body {
  display: grid;
  grid-template-columns: 166px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 20px;
}

.profile-photo-column {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.profile-title-card h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 2.4vw, 34px);
}

.profile-title-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto 1fr auto;
  grid-template-areas:
    "name"
    "."
    "title"
    "."
    "quote";
  column-gap: 10px;
  row-gap: 0;
  align-items: stretch;
  padding-left: .45cm;
  min-height: 176px;
}

.profile-title-card h1 {
  grid-area: name;
  transform: translateY(-6px);
}

.profile-title-card h3 {
  grid-area: title;
  align-self: center;
  margin: 0;
  color: var(--profile-rank-color, var(--ink));
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.12;
  font-weight: 700;
  transform: translateY(-6px);
}

.rank-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 46px;
  padding: 4px 12px;
  border: 2px solid currentColor;
  border-radius: 10px;
  color: var(--profile-rank-color, var(--ink));
  font-size: 30px;
  font-weight: 900;
}

.profile-title-card blockquote {
  grid-area: quote;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-style: italic;
  line-height: 1.45;
  transform: translateY(-6px);
}

.profile-title-card blockquote::before {
  content: "“";
}

.profile-title-card blockquote::after {
  content: "”";
}

.profile-summary.podium-gold {
  --profile-rank-color: #b88900;
  background: var(--soft-gold);
  border-color: rgba(184, 137, 0, .34);
  box-shadow: inset 6px 0 0 var(--gold-bar), 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.profile-summary.podium-silver {
  --profile-rank-color: #7d8792;
  background: #e9edf2;
  border-color: rgba(125, 135, 146, .34);
  box-shadow: inset 6px 0 0 #cfd6df, 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.profile-summary.podium-bronze {
  --profile-rank-color: #a7612f;
  background: #ffe5c7;
  border-color: rgba(167, 97, 47, .34);
  box-shadow: inset 6px 0 0 #c9894e, 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.file-button {
  width: 128px;
  min-height: 27px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #f5f7fa !important;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

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

.avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #eaf2fb;
}

.dashboard-side-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  column-gap: 18px;
  width: 100%;
  min-height: 60px;
  align-self: start;
  transform: translate(-18px, calc(72px - 10pt));
}

.dashboard-side-actions .dashboard-actions {
  grid-column: 2;
  justify-self: end;
}

.dashboard-side-actions.has-resume-game .dashboard-resume-button {
  grid-column: 1;
}

.dashboard-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: end;
  gap: 18px;
  min-height: 0;
}

.dashboard-action-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--electric-blue);
  box-shadow: none;
}

.dashboard-action-button svg {
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-action-button:hover {
  filter: saturate(1.12) contrast(1.04);
  color: var(--electric-blue);
}

.dashboard-action-button:focus-visible {
  outline: 2px solid rgba(25, 48, 173, .32);
  outline-offset: 5px;
}

.dashboard-logout-icon,
.dashboard-info-icon {
  margin-bottom: 0;
}

.dashboard-logout-icon svg {
  transform: translate(1px, -3px);
}

.dashboard-settings-icon svg {
  fill: none;
  stroke: currentColor;
}

.dashboard-resume-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 10px;
  transform: translateX(47px);
  min-height: 66px;
  padding: 10px 20px;
  border: 1px solid rgba(184, 137, 0, .28);
  border-radius: 24px;
  background: var(--soft-gold);
  color: #111827;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 10px 26px rgba(184, 137, 0, .13);
}

.dashboard-resume-button svg {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-resume-button:hover {
  filter: saturate(1.08) contrast(1.03);
  color: var(--electric-blue);
}


.dashboard-title {
  grid-area: title;
  align-self: end;
  justify-self: center;
  margin: 0;
  position: relative;
  color: var(--electric-blue);
  font-size: clamp(64px, 9vw, 116px);
  line-height: .82;
  letter-spacing: 0;
  transform: translateY(calc((18px - 185px + .82em) / 2));
}

.ranking-block,
.latest-game-block {
  height: 479px;
  min-height: 0;
  overflow: hidden;
}

.ranking-block {
  grid-area: ranking;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.latest-game-block {
  grid-area: latest;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, .94) 0%, rgba(229, 233, 240, .34) 38%, rgba(255, 255, 255, .88) 62%, rgba(220, 226, 235, .26) 100%),
    linear-gradient(42deg, rgba(210, 216, 226, .22) 0%, transparent 31%, rgba(255, 255, 255, .62) 54%, transparent 78%),
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .95) 0 12%, transparent 32%),
    radial-gradient(circle at 78% 70%, rgba(205, 212, 224, .28) 0 10%, transparent 28%),
    #f8fafc;
}

.quick-game-actions {
  grid-area: quick;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 100px));
  align-content: stretch;
  gap: calc(79px / 3);
  justify-self: center;
  width: 90%;
  min-height: 0;
}

.quick-game-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 16px 14px;
  border: 1px solid rgba(184, 137, 0, .28);
  border-radius: 24px;
  background: var(--soft-gold);
  color: #111827;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 14px 34px rgba(184, 137, 0, .13);
}

.quick-game-button:hover {
  filter: saturate(1.08) contrast(1.03);
  color: var(--electric-blue);
}

.latest-game-block h2 {
  margin: 0 0 10px;
  font-size: 34px;
}

.news-content {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 4px 8px 0;
  color: #1f2b3a;
  font-family: inherit;
  font-size: 17px;
  line-height: 1.55;
}

.news-content p {
  margin: 0;
}

.news-active-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.news-content .news-active-game-link {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--electric-blue);
}

.news-active-game-link svg {
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.news-content .news-active-game-link:hover {
  color: var(--electric-blue);
  filter: saturate(1.12) contrast(1.04);
}

.news-content .news-active-game-link:focus-visible {
  outline: 2px solid rgba(25, 48, 173, .32);
  outline-offset: 4px;
}

.news-separator {
  display: grid;
  grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.news-separator::before,
.news-separator::after {
  content: "";
  height: 1px;
  background: rgba(125, 135, 146, .36);
}

.news-separator span {
  width: 7px;
  height: 7px;
  border: 1px solid var(--electric-blue);
  background: var(--electric-blue);
  transform: rotate(45deg);
}

.news-footnote {
  margin-top: 0;
  padding: 0 4px 2px 0;
}

.ranking-block .news-footnote {
  margin-top: 5px;
}

.news-footnote a,
.news-footnote strong {
  color: #111827;
  font-weight: 900;
}

.news-footnote a:hover {
  color: var(--electric-blue);
}

.news-content p:first-child::first-letter {
  float: left;
  margin: 6px 8px 0 0;
  color: #202b38;
  font-size: 52px;
  line-height: .78;
  font-weight: 850;
}

.news-player {
  color: #111827;
  font-weight: 900;
}

.news-trophy {
  font-weight: 900;
}

.news-trophy-base {
  color: #16a34a;
}

.news-trophy-hidden {
  color: #2563eb;
}

.news-trophy-secret {
  color: #9333ea;
}

.news-points {
  color: var(--accent);
  font-weight: 900;
}

.news-content a {
  color: #111827;
  font-weight: 850;
  text-decoration: none;
}

.inline-link {
  width: fit-content;
}

.latest-actions {
  justify-content: flex-start;
  gap: 8px;
}

.mini-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.mini-metrics span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 750;
}

.mini-metrics strong {
  color: var(--ink);
  font-size: 20px;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  margin-bottom: 16px;
}

.tab-button {
  min-height: 34px;
  border: 0;
  background: transparent;
}

.tab-button.active {
  background: var(--accent);
  color: #fff;
}

.dashboard-tabs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  margin-bottom: 18px;
  color: var(--muted);
}

.dashboard-tabs.single-tab {
  display: flex;
  justify-content: center;
}

.dashboard-tabs .tab-button {
  justify-self: center;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  box-shadow: none;
  cursor: default;
}

.dashboard-tabs .tab-button.active {
  background: transparent;
  color: var(--ink);
}

.dashboard-tab-separator {
  width: 1px;
  height: 26px;
  background: var(--muted);
  opacity: .55;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.ranking-block .tab-panel.active {
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.ranking-row,
.simple-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.simple-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.rank-number {
  color: var(--accent);
  font-weight: 900;
}

.ranking-row small,
.simple-row small {
  color: var(--muted);
}

.dashboard-ranking-table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

.dashboard-ranking-table thead,
.dashboard-ranking-table tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.dashboard-ranking-table tbody {
  display: block;
  max-height: 290px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.dashboard-ranking-table th,
.dashboard-ranking-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.dashboard-ranking-table th {
  color: var(--muted);
  font-weight: 850;
}

.dashboard-ranking-table th:nth-child(1),
.dashboard-ranking-table td:nth-child(1) {
  width: 15%;
}

.dashboard-ranking-table th:nth-child(2),
.dashboard-ranking-table td:nth-child(2) {
  width: 20%;
}

.dashboard-ranking-table th:nth-child(3),
.dashboard-ranking-table td:nth-child(3) {
  width: calc(65% - 112px);
}

.dashboard-ranking-table th.ranking-sort-column,
.dashboard-ranking-table th:nth-child(4),
.dashboard-ranking-table td:nth-child(4) {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
}

.dashboard-ranking-table th.ranking-sort-column {
  position: relative;
  overflow: visible;
}

.ranking-sort-header {
  display: inline-grid;
  place-items: center;
  width: 112px;
  transform: translateX(-9px);
}

.ranking-sort-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}

.ranking-sort-toggle::before {
  content: "\00a0\00a0\25be";
  visibility: hidden;
  font-size: 20px;
  line-height: 1;
}

.ranking-sort-arrow {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  white-space: pre;
  transform: translateY(-2px);
}

.ranking-sort-toggle:hover,
.ranking-sort-toggle[aria-expanded="true"] {
  color: var(--electric-blue);
  background: transparent;
}

.ranking-sort-toggle:hover .ranking-sort-arrow,
.ranking-sort-toggle[aria-expanded="true"] .ranking-sort-arrow {
  color: var(--electric-blue);
}

.ranking-sort-menu {
  position: absolute;
  top: calc(100% - 2px);
  right: 4px;
  z-index: 20;
  display: grid;
  min-width: 172px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 43, 58, .14);
}

.ranking-sort-menu[hidden] {
  display: none;
}

.ranking-sort-menu button {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
}

.ranking-sort-menu button:hover,
.ranking-sort-menu button.active {
  color: var(--electric-blue);
  background: rgba(25, 48, 173, .08);
}

.dashboard-ranking-table td {
  color: var(--ink);
}

.dashboard-ranking-table tbody tr.dashboard-rank-gold {
  background: var(--soft-gold);
}

.dashboard-ranking-table tbody tr.dashboard-rank-silver {
  background: #e9edf2;
}

.dashboard-ranking-table tbody tr.dashboard-rank-bronze {
  background: #ffe5c7;
}

.dashboard-player-cell {
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  line-height: 1.15;
}

.dashboard-player-cell small {
  display: block;
  margin-left: 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-ranking-table td:nth-child(3) {
  text-align: center;
  white-space: nowrap;
  font-size: 14px;
}

.dashboard-ranking-table strong {
  color: var(--accent);
}

.ranking-value-with-change {
  display: inline-grid;
  grid-template-columns: minmax(28px, auto) 15px;
  align-items: center;
  column-gap: 4px;
}

.ranking-rank-with-change {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.ranking-rank-with-change .ranking-change-arrow {
  position: absolute;
  top: 50%;
  left: calc(50% + 18px);
  transform: translateY(-50%);
}

.ranking-metric-with-change {
  position: relative;
  display: inline-flex;
  justify-content: center;
  width: 112px;
  transform: translateX(-8px);
}

.ranking-metric-with-change .ranking-change-arrow {
  position: absolute;
  top: 50%;
  left: calc(50% + 25px);
  transform: translateY(-50%);
}

.ranking-value-number {
  justify-self: end;
}

.ranking-change-arrow {
  justify-self: start;
  color: var(--muted);
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.ranking-change-arrow:empty {
  visibility: hidden;
}

.ranking-change-arrow[hidden] {
  display: inline-block;
  visibility: hidden;
}

.ranking-change-up {
  color: var(--ok);
}

.ranking-change-down {
  color: var(--danger);
}

.dashboard-ranking-table .avatar-small {
  display: block;
  margin: 0 auto;
}

.ranking-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ranking-crown {
  position: absolute;
  top: -13px;
  right: -10px;
  z-index: 1;
  color: #b88900;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 253, 241, .92), 0 5px 9px rgba(31, 43, 58, .16);
  transform: rotate(18deg);
  transform-origin: 50% 80%;
  pointer-events: none;
}

.dashboard-ranking-table .clickable-row {
  cursor: pointer;
}

.dashboard-ranking-table .clickable-row:hover {
  filter: saturate(1.05) contrast(1.02);
}

.dashboard-ranking-table .clickable-row:hover .dashboard-player-name {
  color: var(--electric-blue);
}

.rules-layout {
  margin: 18px auto 0;
  max-width: 840px;
  width: min(840px, calc(100% - 36px));
}

.rules-layout h1 {
  margin: 0;
  font-size: 47px;
  line-height: .98;
  letter-spacing: 0;
  text-align: center;
}

.rules-panel {
  margin-top: 38px;
}

.rules-panel h2 {
  margin: 24px 0 8px;
  font-size: 20px;
}

.rules-panel h2:first-child {
  margin-top: 0;
}

.rules-panel p {
  margin: 0 0 10px;
  text-align: justify;
}

.elo-formula {
  display: grid;
  gap: 8px;
  justify-items: center;
  margin: 14px auto;
  padding: 4px 0;
  overflow-x: auto;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.55;
  text-align: center;
  white-space: nowrap;
}

.math-var,
.math-inline {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.math-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  vertical-align: middle;
  text-align: center;
  line-height: 1.1;
}

.math-fraction > span:first-child {
  padding: 0 8px 2px;
  border-bottom: 1px solid currentColor;
}

.math-fraction > span:last-child {
  padding: 2px 8px 0;
}

.math-large-paren {
  display: inline-block;
  transform: scaleY(2.15);
  transform-origin: center;
  vertical-align: middle;
}

.math-root {
  display: inline-flex;
  align-items: flex-start;
  vertical-align: middle;
}

.math-root > span:last-child {
  padding: 1px 4px 0 3px;
  border-top: 1px solid currentColor;
}

.rules-trophy-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.rules-trophy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rules-trophy-table th,
.rules-trophy-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.rules-trophy-table th {
  color: var(--muted);
  font-weight: 850;
}

.rules-trophy-icon {
  font-size: 23px;
  line-height: 1.2;
}

.rules-trophy-base {
  color: #4ade80;
  font-weight: 800;
}

.rules-trophy-hidden {
  color: #60a5fa;
  font-weight: 800;
}

.rules-trophy-secret {
  color: #c084fc;
  font-weight: 800;
}

.avatar-form {
  display: grid;
  gap: 10px;
  margin: 0;
}

.auth-card {
  width: min(520px, 100%);
  margin: 48px auto;
  padding: 28px;
}

.page:has(.login-card) {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.login-card {
  margin: 0 auto;
}

.login-card h1 {
  text-align: center;
}

.page:has(.register-card) {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 0;
}

.register-card {
  margin: 0 auto;
}

.register-card h1 {
  text-align: center;
}

.auth-card.wide {
  width: min(760px, 100%);
}

.auth-card h1 {
  font-size: 38px;
  margin-bottom: 24px;
}

.auth-card.wide h1 {
  text-align: center;
}

.new-game-subtitle {
  margin: -10px 0 24px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 750;
  text-align: center;
}

.choice-separator {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
}

.new-game-choice-block {
  display: grid;
  gap: 7px;
}

.new-game-choice-label {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.new-game-choice-block small {
  color: var(--muted);
  font-weight: 600;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 750;
}

.username-autocomplete {
  position: relative;
}

.username-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(31, 43, 58, .16);
}

.username-suggestions.visible {
  display: grid;
}

.username-suggestion {
  justify-content: flex-start;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-size: 14px;
  text-align: left;
}

.username-suggestion:hover,
.username-suggestion.active {
  background: #eef7ff;
  color: var(--accent);
}

.label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.field-help {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.help-icon {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d5dbe4;
  color: #52616f;
  font: 800 10px/14px system-ui, sans-serif;
  cursor: help;
  transform: translateY(-4px);
}

.help-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(300px, 78vw);
  padding: 10px 12px;
  border-radius: 8px;
  background: #202b38;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 14px 34px rgba(23, 35, 50, .22);
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + var(--help-tooltip-shift, 0px)), 4px);
  transition: opacity .08s ease, transform .08s ease;
}

.field-help:hover .help-tooltip,
.field-help:focus-within .help-tooltip {
  opacity: 1;
  transform: translate(calc(-50% + var(--help-tooltip-shift, 0px)), 0);
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

label small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

input:focus {
  outline: 3px solid rgba(25, 48, 173, .17);
  border-color: var(--accent);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 84px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: 750 12px/1 system-ui, sans-serif;
  transform: translateY(-50%);
}

.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
  background: #eef7ff;
}

.history-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 16px 4px;
}

.history-page-link {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.history-page-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.history-page-link.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #eaf6ef;
  color: #075b36;
  border: 1px solid #bfe5cd;
  font-weight: 700;
}

.flash.error {
  background: #fff0ee;
  color: var(--danger);
  border-color: #f4b9b2;
}

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

.game-row,
.opponent-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-row {
  grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
}

.player-main-link {
  display: grid;
  gap: 2px;
}

.player-main-link span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.inline-role-form {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
}

.inline-role-form select {
  min-height: 34px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft-gold);
  color: #8b5b00;
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
}

.pill.done {
  background: #eaf6ef;
  color: var(--ok);
  box-shadow: none;
}

.player-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  grid-auto-rows: 64px;
  gap: 10px;
  max-height: 138px;
  overflow-y: auto;
  padding-right: 4px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.check-row span,
.check-row small {
  display: block;
}

.check-row small {
  color: var(--muted);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.check-row small {
  color: var(--muted);
}

.guest-check-row small {
  font-style: italic;
}

.scoreboards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(429px, 493px));
  column-gap: 43px;
  row-gap: 43px;
  justify-content: center;
  margin-top: 14px;
}

@media (min-width: 761px) {
  .page:has(.game-board-shell) {
    width: min(1550px, calc(100% - 32px));
    padding-top: 18px;
    padding-bottom: 12px;
  }

  .game-toolbar {
    display: none;
  }

  .game-board-shell {
    --game-scale: 1;
    overflow: visible;
  }

  .game-board-shell .scoreboards {
    transform: scale(var(--game-scale));
    transform-origin: top center;
  }

  .game-board-shell.game-board-fit-pending .scoreboards {
    visibility: hidden;
    animation: reveal-pending-game-boards 0s linear 1.5s forwards;
  }

  .scoreboards {
    margin-top: 22px;
  }

  .page:has(.game-board-shell) .game-actions {
    gap: 50px;
  }

  .page:has(.game-board-shell) .game-title-date {
    display: inline-block;
    transform: translateY(-10px);
  }

  .page:has(.game-board-shell) .game-footnote {
    margin-top: 12px;
  }
}

@keyframes reveal-pending-game-boards {
  to {
    visibility: visible;
  }
}

.game-board-shell {
  position: relative;
  width: min(100%, 1550px);
  margin: 0 auto;
}

.game-board-shell.single-scoreboard {
  width: min(100%, 1550px);
}

.game-actions {
  position: fixed;
  top: 50%;
  left: 18px;
  z-index: 30;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  margin-bottom: 0;
  transform: translateY(-50%);
}

.game-progress {
  position: fixed;
  top: 50%;
  right: 18px;
  z-index: 30;
  width: 42px;
  height: 318px; /* 4 boutons de 42px + 3 écarts de 50px. */
  min-width: 42px;
  overflow: hidden;
  border: 2px solid var(--electric-blue);
  border-radius: 8px;
  background: transparent;
  transform: translateY(-50%);
}

.game-progress-segments {
  position: absolute;
  inset: 2px;
  display: grid;
  grid-template-rows: repeat(26, minmax(0, 1fr));
  gap: 2px;
}

.game-progress-segment {
  min-height: 0;
  border-radius: 2px;
  background: #fff;
}

.game-progress-segment:first-child {
  border-radius: 4px 4px 2px 2px;
}

.game-progress-segment:last-child {
  border-radius: 2px 2px 4px 4px;
}

.game-progress-segment.filled {
  background: rgba(25, 48, 173, .18);
}

.game-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 2px solid var(--electric-blue);
  border-radius: 8px;
  background: transparent;
  color: var(--electric-blue);
  box-shadow: none;
}

.game-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.game-points-button,
.game-edit-button,
.game-cancel-button,
.game-delete-button,
.game-return-button {
  border-color: var(--electric-blue);
  background: transparent;
  color: var(--electric-blue);
}

.game-points-button[aria-pressed="true"] {
  border-color: var(--electric-blue);
  background: var(--electric-blue);
  color: #ffffff;
}

.game-delete-button:hover,
.game-points-button:hover,
.game-edit-button:hover,
.game-cancel-button:hover,
.game-return-button:hover {
  filter: saturate(1.08) contrast(1.03);
}

.game-title-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  margin: 0 auto 16px;
  text-align: center;
}

.game-title-section h1 {
  grid-column: 2;
  margin: 0;
  font-size: 47px;
  line-height: .98;
  letter-spacing: 0;
}

.game-observers {
  grid-column: 3;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  width: 34px;
  height: 34px;
  color: var(--electric-blue);
  transform: translateX(-200px);
}

.game-observers[hidden] {
  display: none;
}

.game-observers svg {
  width: 31px;
  height: 31px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.game-title-date {
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
}

.scoreboards.single-scoreboard {
  grid-template-columns: minmax(429px, 493px);
}

.scoreboards.game-players-2 {
  grid-template-columns: repeat(2, minmax(429px, 493px));
  column-gap: 86px;
}

.scoreboards.game-players-3 {
  grid-template-columns: repeat(3, minmax(429px, 493px));
}

.scoreboards.game-players-4 {
  grid-template-columns: repeat(2, minmax(429px, 493px));
  column-gap: 86px;
}

.scoreboards.single-scoreboard .scoreboard {
  width: min(493px, 100%);
}

.scoreboard {
  --scoreboard-color: #6f2f8f;
  --scoreboard-outline-color: var(--scoreboard-color);
  --scoreboard-header-bg: linear-gradient(180deg, #6f2f8f 0%, #f5e8fb 100%);
  --scoreboard-highlight-bg: #f5e8fb;
  --scoreboard-turn-shadow: rgba(111, 47, 143, .22);
  overflow: hidden;
}

.scoreboard.rank-gold {
  --scoreboard-color: #f4d36b;
  --scoreboard-outline-color: var(--scoreboard-color);
  --scoreboard-header-bg: linear-gradient(180deg, #f4d36b 0%, #fffdf1 100%);
  --scoreboard-highlight-bg: var(--soft-gold);
  --scoreboard-turn-shadow: rgba(244, 211, 107, .34);
}

.scoreboard.rank-silver {
  --scoreboard-color: #cfd6df;
  --scoreboard-outline-color: #7f8b98;
  --scoreboard-header-bg: linear-gradient(180deg, #cfd6df 0%, #ffffff 100%);
  --scoreboard-highlight-bg: #e9edf2;
  --scoreboard-turn-shadow: rgba(127, 139, 152, .34);
}

.scoreboard.rank-bronze {
  --scoreboard-color: #c9894e;
  --scoreboard-outline-color: var(--scoreboard-color);
  --scoreboard-header-bg: linear-gradient(180deg, #c9894e 0%, #fff8f0 100%);
  --scoreboard-highlight-bg: #ffe5c7;
  --scoreboard-turn-shadow: rgba(201, 137, 78, .34);
}

.scoreboard.rank-blue {
  --scoreboard-color: var(--electric-blue);
  --scoreboard-outline-color: var(--scoreboard-color);
  --scoreboard-header-bg: linear-gradient(180deg, var(--electric-blue) 0%, #eef2ff 100%);
  --scoreboard-highlight-bg: rgba(25, 48, 173, .18);
  --scoreboard-turn-shadow: rgba(25, 48, 173, .22);
}

.scoreboard.current-turn {
  border-color: var(--scoreboard-outline-color);
  outline: 3px solid var(--scoreboard-outline-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--scoreboard-turn-shadow), 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.scoreboard.game-winner {
  border-color: #f4d36b;
  box-shadow: 0 0 0 4px rgba(244, 211, 107, .34), 0 0 34px 10px rgba(244, 211, 107, .48), 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.scoreboard.current-turn.game-winner {
  outline-color: #f4d36b;
  box-shadow: 0 0 0 4px rgba(244, 211, 107, .36), 0 0 38px 12px rgba(244, 211, 107, .52), 0 14px 38px rgba(31, 43, 58, .11), 0 2px 8px rgba(31, 43, 58, .05);
}

.winner-confetti {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(-1px);
}

.scoreboard header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  color: #fff;
  background: var(--scoreboard-header-bg);
}

.scoreboard.rank-gold header,
.scoreboard.rank-silver header,
.scoreboard.rank-bronze header,
.scoreboard.rank-blue header {
  color: #202b38;
}

.scoreboard.rank-gold h2 a,
.scoreboard.rank-silver h2 a,
.scoreboard.rank-bronze h2 a,
.scoreboard.rank-blue h2 a {
  color: #202b38;
}

.scoreboard-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  font-weight: 900;
}

.scoreboard h2,
.stats-panel h2 {
  margin: 0;
  font-size: 20px;
}

.scoreboard h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 900;
}

.scoreboard h2 a {
  color: #fff;
  text-decoration: none;
}

.scoreboard h2 a:hover {
  text-decoration: none;
}

.guest-name-form {
  display: inline-flex;
  margin: 0;
}

.guest-name-form button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.guest-name-form button:hover {
  background: rgba(255, 255, 255, .28);
}

.game-footnote {
  margin: 34px auto 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.landing-hero + .game-footnote {
  margin-top: 24px;
}

.support-footnote {
  margin-top: 8px;
}

.support-footnote a {
  color: var(--electric-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-wrap {
  overflow-x: auto;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 413px;
  font-size: 13.5px;
}

.score-table tr {
  height: 36px;
}

.score-table th,
.score-table td {
  height: 36px;
  border-top: 1px solid var(--line);
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.08;
}

.score-table th:first-child {
  width: 109px;
  text-align: center;
}

.score-table thead th {
  background: var(--scoreboard-highlight-bg);
  font-size: 13.5px;
}

.score-table td.filled {
  background: #f8fbff;
}

.score-table td.upper-best {
  background: #9fdf86;
}

.score-table td.upper-strong {
  background: #c6eeb8;
}

.score-table td.upper-low {
  background: #ffd6a5;
}

.score-table td.upper-very-low {
  background: #ffbd76;
}

.score-table td.upper-zero {
  background: #ffa85b;
}

.score-table td.locked {
  background: #f6f6f6;
}

.score-table .bonus-row th,
.score-table .bonus-row td {
  background: var(--scoreboard-highlight-bg);
  font-weight: 850;
}

.score-table .difference-row small {
  color: var(--muted);
  font-size: inherit;
  font-weight: 850;
}

.score-table .difference-row small.difference-score-high {
  color: var(--ok);
}

.score-table .difference-row small.difference-score-low {
  color: #8b5b00;
}

.score-table .bonus-ok {
  color: var(--ok);
  font-weight: 850;
}

.score-table .bonus-missing {
  color: #8b5b00;
}

.score-table .bonus-pending {
  color: #8b5b00;
  font-weight: 850;
}

.score-table .bonus-progress-score {
  font-weight: 400;
}

.score-table .separator-row,
.score-table .separator-row td {
  height: 9px;
}

.score-table .separator-row td {
  padding: 0;
  background: #e8eef5;
  border-top: 1px solid #d3dce7;
}

.score-table small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.score-table .cell-score {
  display: none;
}

.game-board-shell.show-cell-points .score-table .cell-score {
  display: block;
}

.cross {
  position: relative;
  display: inline-block;
  color: var(--danger);
  font-weight: 900;
}

.cell-form {
  display: block;
}

.cell-form input {
  height: 27px;
  min-height: 27px;
  padding: 0 5px;
  text-align: center;
}

.score-table td > span:not(.trophy-tooltip),
.score-table td > small {
  line-height: 1.08;
}

.score-table td > span:not(.trophy-tooltip) {
  display: inline-grid;
  min-height: 14px;
  place-items: center;
}

.score-table td > span:not(.trophy-tooltip):only-child {
  min-height: 27px;
}

.score-table tfoot th,
.score-table tfoot td {
  background: #f7f9fb;
  font-weight: 850;
}

.score-table .total-row th,
.score-table .total-row td,
.score-table .grand-total-row th,
.score-table .grand-total-row td {
  background: var(--scoreboard-highlight-bg);
}

.score-table .total-row th {
  color: var(--ink);
}

.score-table .total-row td {
  color: var(--muted);
}

.score-table .total-row td.total-score-high {
  color: var(--ok);
}

.score-table .total-row td.total-score-low {
  color: #8b5b00;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.profile-radar-panel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.profile-left-column,
.profile-right-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  height: var(--profile-column-height);
  min-height: 0;
}

.profile-lower-right {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr);
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.profile-side-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.profile-history,
.profile-radar-panel,
.profile-opponents,
.profile-trophies {
  height: auto;
  min-height: 0;
}

.profile-history,
.profile-opponents,
.profile-trophies {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.profile-history > h2,
.profile-stats > h2,
.profile-opponents > h2,
.profile-trophies > h2 {
  text-align: center;
}

.profile-scroll-area {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.stats-panel {
  padding: 20px;
}

.stats-panel.span {
  grid-column: 1 / -1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.metrics div {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.radar {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0 auto;
}

.profile-panel-content[data-profile-panel="radar"] .radar {
  transform: translateY(-10px);
}

.score-distribution,
.rank-history-chart {
  width: 100%;
  max-width: 520px;
  display: block;
  margin: 16px auto 0;
}

.score-tooltip {
  position: fixed;
  z-index: 80;
  display: none;
  padding: 5px 8px;
  border-radius: 8px;
  background: #202b38;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(31, 43, 58, .18);
}

.game-progress-tooltip {
  text-align: center;
  white-space: pre-line;
}

.profile-panel-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 18px;
}

.profile-panel-tab {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
}

.profile-panel-tab.active {
  color: var(--ink);
}

.profile-panel-separator {
  width: 1px;
  height: 26px;
  background: var(--muted);
  opacity: .55;
}

.profile-panel-content {
  display: none;
}

.profile-panel-content.active {
  display: block;
}

.profile-distribution-panel.active,
.profile-rank-history-panel.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.profile-distribution-panel .score-distribution,
.profile-rank-history-panel .rank-history-chart {
  margin: auto auto;
}

.profile-rank-history-panel .rank-history-chart {
  transform: translateY(18px);
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 10px 8px;
  padding-top: 12px;
}

.trophy-count {
  color: inherit;
  font: inherit;
}

.trophy-scroll-area {
  overflow-y: auto;
}

.trophy-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  color: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  text-shadow: 0 1px 1px rgba(20, 30, 45, .18);
}

.trophy-icon:hover {
  transform: translateY(-1px);
}

.trophy-new-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 1;
  color: #b88900;
  font-size: 8px;
  font-weight: 950;
  line-height: 1.25;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 253, 241, .95), 0 3px 7px rgba(31, 43, 58, .16);
  transform: translateX(-50%);
  pointer-events: none;
}

.trophy-tooltip {
  display: none;
}

.floating-trophy-tooltip {
  position: fixed;
  left: 50vw;
  top: 50vh;
  z-index: 9999;
  width: max-content;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% + 4px));
  transition: opacity .08s ease, transform .08s ease;
}

.floating-trophy-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -100%);
}

.floating-trophy-tooltip.tooltip-below {
  transform: translate(-50%, -4px);
}

.floating-trophy-tooltip.tooltip-below.visible {
  transform: translate(-50%, 0);
}

.trophy-tooltip-title,
.trophy-tooltip-description {
  display: block;
}

.trophy-tooltip-title {
  margin-bottom: 4px;
  font-weight: 850;
}

.trophy-tooltip-title-base {
  color: #4ade80;
}

.trophy-tooltip-title-hidden {
  color: #60a5fa;
}

.trophy-tooltip-title-secret {
  color: #c084fc;
}

.trophy-tooltip-description {
  color: #fff;
}

.avatar-form .file-button {
  background-color: #f5f7fa !important;
}

.profile-radar-note {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.profile-radar-note p {
  margin: 0;
}

.profile-radar-note p + p {
  margin-top: 8px;
}

.profile-rank-history-panel .profile-radar-note {
  position: relative;
  z-index: 5;
  flex: 0 0 1.2em;
  height: 1.2em;
}

.rank-history-season-picker {
  position: relative;
  display: inline-block;
}

.rank-history-season-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.rank-history-season-toggle > span {
  margin-left: .25em;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  transform: translateY(-2px);
}

.rank-history-season-toggle:hover,
.rank-history-season-toggle[aria-expanded="true"] {
  color: var(--electric-blue);
}

.rank-history-season-toggle:hover > span,
.rank-history-season-toggle[aria-expanded="true"] > span {
  color: var(--electric-blue);
}

.rank-history-season-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 30;
  display: grid;
  min-width: 92px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(31, 43, 58, .14);
  transform: translateX(-50%);
}

.rank-history-season-menu[hidden] {
  display: none;
}

.rank-history-season-menu button {
  width: 100%;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.rank-history-season-menu button:hover,
.rank-history-season-menu button.active {
  color: var(--electric-blue);
  background: rgba(25, 48, 173, .08);
}

.profile-radar-position-spacer {
  visibility: hidden;
}

.profile-radar-note .note-link {
  color: var(--ink);
  font-weight: 850;
}

.profile-radar-note .note-link:hover {
  color: var(--electric-blue);
}

.profile-radar-note .note-blue {
  color: var(--accent);
}

.profile-radar-note .note-gray {
  color: #7b8794;
}

.profile-mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.profile-mini-table th,
.profile-mini-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.profile-mini-table th {
  color: var(--muted);
  font-weight: 850;
}

.profile-mini-table td {
  color: var(--ink);
}

.profile-mini-table strong {
  color: var(--accent);
}

.profile-mini-table .avatar-small {
  display: block;
  margin: 0 auto;
}

.profile-opponents .profile-mini-table th,
.profile-opponents .profile-mini-table td {
  padding: 7px 8px;
}

.profile-opponents .profile-mini-table .avatar-small {
  width: 32px;
  height: 32px;
}

.profile-mini-table .clickable-row {
  cursor: pointer;
}

.profile-mini-table tbody tr.dashboard-rank-gold {
  background: #fff1bd;
  box-shadow: inset 5px 0 0 #f4d36b;
}

.profile-mini-table tbody tr.dashboard-rank-silver {
  background: #e9edf2;
  box-shadow: inset 5px 0 0 #cfd6df;
}

.profile-mini-table tbody tr.dashboard-rank-bronze {
  background: #ffe5c7;
  box-shadow: inset 5px 0 0 #c9894e;
}

.profile-mini-table .clickable-row:hover {
  background: #f8fafc;
}

.profile-opponents .profile-mini-table .clickable-row:hover .profile-opponent-name {
  color: var(--electric-blue);
}

.profile-mini-table tbody tr.dashboard-rank-gold:hover {
  background: #fff1bd;
}

.profile-mini-table tbody tr.dashboard-rank-silver:hover {
  background: #e9edf2;
}

.profile-mini-table tbody tr.dashboard-rank-bronze:hover {
  background: #ffe5c7;
}

.history-layout {
  width: min(1120px, calc(100% - 36px));
  margin: 18px auto 0;
}

.history-layout h1 {
  margin: 0;
  font-size: 47px;
  line-height: .98;
  letter-spacing: 0;
  text-align: center;
}

.history-table-panel {
  margin-top: 38px;
}

.season-history-section {
  margin-top: 38px;
}

.season-history-section h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 24px;
}

.season-history-section .profile-mini-table {
  margin-top: 0;
}

.history-table {
  font-size: 14px;
}

.history-table th,
.history-table td {
  padding: 12px 10px;
}

.history-table td:nth-child(3) {
  text-align: center;
}

.compact-form {
  margin-top: 16px;
}

.member-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.member-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.member-row small {
  color: var(--muted);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.empty,
.muted {
  color: var(--muted);
}

.settings-layout {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
  margin: 18px auto 0;
  width: min(1040px, calc(100% - 36px));
}

.settings-layout h1 {
  margin: 0;
  font-size: 47px;
  line-height: .98;
  letter-spacing: 0;
  text-align: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 68px;
  margin-top: 72px;
}

.settings-grid-admin {
  margin-block: auto;
  padding-block: 70px;
}

.settings-grid-member {
  grid-template-columns: minmax(0, 480px);
  justify-content: center;
  margin-block: auto;
  padding-block: 70px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 370px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #111827;
  box-shadow: 0 14px 34px rgba(31, 43, 58, .13);
}

.settings-card h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
}

.settings-card-muted {
  border-color: #c8d0da;
  background: linear-gradient(135deg, #ffffff 0%, #d5dbe4 52%, #aeb8c5 100%);
}

.settings-card-danger {
  border-color: #d9382f;
  background: linear-gradient(135deg, #ffefed 0%, #e0372d 52%, #b42318 100%);
}

.settings-card-secret {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(480px, 100%);
  min-height: 230px;
  border-color: rgba(184, 137, 0, .28);
  background: var(--soft-gold);
  box-shadow: 0 14px 34px rgba(184, 137, 0, .13);
}

.settings-card-secret .settings-search-form button {
  border-color: rgba(184, 137, 0, .55);
  background: var(--gold-bar);
  color: #111827;
}

.settings-card:hover {
  filter: saturate(1.06) contrast(1.03);
  color: #111827;
}

.settings-search-form {
  margin: 0;
}

.settings-search-form label {
  display: grid;
  gap: 16px;
  color: #202b38;
  font-weight: 850;
}

.settings-priority-body {
  display: grid;
  align-content: center;
  flex: 1;
  gap: 24px;
  padding-top: 10px;
}

.settings-account-body {
  display: grid;
  align-content: center;
  flex: 1;
  gap: 18px;
  padding-top: 10px;
}

.settings-account-form label {
  gap: 10px;
}

.settings-account-label {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

.settings-account-form small {
  color: var(--muted);
  font-size: inherit;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.settings-inline-muted {
  color: var(--muted);
  font-size: inherit;
  font-weight: 800;
}

.settings-nowrap-label {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.settings-nowrap-label .settings-inline-muted {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.settings-search-row .username-autocomplete {
  width: 100%;
}

.settings-search-row .password-field {
  width: 100%;
}

.settings-search-form .password-visibility-toggle {
  width: auto;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 750;
}

.settings-search-form .password-visibility-toggle:hover,
.settings-search-form .password-visibility-toggle:focus-visible {
  background: #eef7ff;
  color: var(--accent);
}

.settings-card-muted .settings-search-form .password-visibility-toggle {
  background: #d5dbe4;
  color: #111;
}

.settings-card-muted .settings-search-form .password-visibility-toggle:hover,
.settings-card-muted .settings-search-form .password-visibility-toggle:focus-visible {
  background: #566271;
  color: #111;
}

.settings-card-danger .settings-search-form .password-visibility-toggle {
  background: #f4b9b2;
  color: #111;
}

.settings-card-danger .settings-search-form .password-visibility-toggle:hover,
.settings-card-danger .settings-search-form .password-visibility-toggle:focus-visible {
  background: #8f2019;
  color: #111;
}

.settings-card-secret .settings-search-form .password-visibility-toggle {
  background: #fff0b3;
  color: #111;
}

.settings-card-secret .settings-search-form .password-visibility-toggle:hover,
.settings-card-secret .settings-search-form .password-visibility-toggle:focus-visible {
  background: var(--gold-bar);
  color: #111;
}

.settings-search-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(100, 115, 134, .45);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.settings-search-form button {
  width: 42px;
  min-height: 46px;
  padding: 0;
  border-color: #566271;
  background: #566271;
  color: #fff;
  font-weight: 900;
}

.settings-search-form .username-suggestion {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.settings-search-form .username-suggestion:hover,
.settings-search-form .username-suggestion.active {
  background: #eef7ff;
  color: var(--accent);
}

.settings-card-danger .settings-search-form button {
  border-color: #8f2019;
  background: #8f2019;
}

.settings-search-form button.username-suggestion,
.settings-card-danger .settings-search-form button.username-suggestion {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.settings-search-form button.username-suggestion:hover,
.settings-search-form button.username-suggestion.active,
.settings-card-danger .settings-search-form button.username-suggestion:hover,
.settings-card-danger .settings-search-form button.username-suggestion.active {
  background: #eef7ff;
  color: var(--accent);
}

.settings-result {
  display: grid;
  gap: 24px;
  margin-top: 0;
  text-align: left;
}

.settings-result p {
  margin: 0;
}

.settings-player-status {
  color: #314256;
  font-weight: 800;
}

.settings-role-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.settings-role-actions .small-button {
  min-height: 38px;
  background: rgba(255, 255, 255, .92);
}

.settings-unavailable {
  align-self: center;
  margin: 0;
  color: #314256;
  font-weight: 850;
  text-align: center;
}

.settings-confirm-banner {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 24, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
}

.settings-confirm-banner > div {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .hero,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 64px;
  }

  .page:has(.landing-hero) {
    overflow-x: hidden;
  }

  .landing-content {
    width: 100%;
    padding: clamp(104px, 17vh, 160px) 18px 0;
    gap: clamp(34px, 6vh, 52px);
    overflow: hidden;
  }

  .landing-hero .landing-title {
    justify-self: center;
    max-width: calc(100vw - 28px);
    font-size: clamp(87px, 25.5vw, 108px);
    transform: none;
  }

  .landing-hero .landing-subtitle {
    justify-self: center;
    width: 100%;
    margin: -20px 0 0;
    padding-left: 0;
    font-size: clamp(24px, 7vw, 30px);
    text-align: center;
    transform: none;
  }

  .landing-hero .landing-actions {
    justify-content: center;
    justify-items: center;
    width: 100%;
    gap: 28px;
    transform: none;
  }

  .button.landing-register-button,
  .button.landing-login-button {
    width: min(100%, 300px);
  }

  .dice-panel {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    padding: 12px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "title"
      "profile"
      "actions"
      "quick"
      "ranking"
      "latest";
    gap: 18px;
  }

  .dashboard-title {
    justify-self: center;
    width: 100%;
    margin-top: 8px;
    font-size: clamp(68px, 22vw, 88px);
    text-align: center;
    transform: none;
  }

  .dashboard-side-actions,
  .dashboard-side-actions.has-resume-game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-self: stretch;
    gap: 12px;
    width: 100%;
    min-height: 0;
    transform: none;
  }

  .dashboard-side-actions .dashboard-actions {
    grid-column: 2;
  }

  .dashboard-side-actions.has-resume-game .dashboard-resume-button {
    grid-column: 1;
  }

  .dashboard-actions {
    min-height: auto;
    justify-content: end;
    gap: 14px;
  }

  .dashboard-resume-button {
    justify-self: start;
    min-height: 66px;
    max-width: 280px;
    padding: 10px 18px;
    font-size: 18px;
    transform: none;
  }

  .quick-game-actions {
    grid-template-rows: repeat(4, minmax(76px, auto));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-card {
    min-height: 190px;
  }

  .home-profile-block {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    transform: none;
  }

  .home-profile-block h1 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .home-profile-block p {
    font-size: clamp(16px, 5vw, 22px);
    line-height: 1.18;
  }

  .home-profile-block .avatar-large {
    width: 96px;
    height: 96px;
  }

  .profile-summary {
    justify-items: stretch;
    overflow: hidden;
  }

  .profile-summary-body {
    grid-template-columns: minmax(118px, 42%) minmax(0, 1fr);
    gap: 14px;
    justify-items: stretch;
  }

  .profile-photo-column {
    justify-items: start;
  }

  .avatar-profile {
    width: min(100%, 158px);
    height: auto;
    aspect-ratio: 1;
  }

  .profile-title-card {
    min-width: 0;
    min-height: 154px;
    padding-left: 0;
    padding-right: 64px;
  }

  .profile-title-card h1 {
    font-size: clamp(26px, 8vw, 38px);
  }

  .profile-title-card h3 {
    font-size: clamp(20px, 5.4vw, 27px);
  }

  .profile-title-card blockquote {
    font-size: clamp(16px, 4.7vw, 23px);
  }

  .profile-layout {
    grid-template-columns: 1fr;
    max-width: 100%;
    overflow-x: hidden;
  }

  .profile-left-column,
  .profile-right-column {
    height: auto;
    min-width: 0;
  }

  .profile-lower-right {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .profile-radar-panel,
  .profile-panel-content,
  .profile-distribution-panel.active,
  .profile-rank-history-panel.active {
    min-width: 0;
    max-width: 100%;
  }

  .score-distribution,
  .rank-history-chart {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-game-row {
    grid-template-columns: 1fr auto;
    padding: 12px;
  }

  .scoreboards {
    grid-template-columns: 1fr;
  }

  .scoreboards.single-scoreboard {
    grid-template-columns: 1fr;
  }

  .scoreboards.multi-scoreboard,
  .scoreboards.game-players-2,
  .scoreboards.game-players-3,
  .scoreboards.game-players-4 {
    grid-template-columns: 1fr;
  }

  .game-board-shell,
  .game-board-shell.single-scoreboard {
    width: 100%;
  }

  .game-actions {
    position: static;
    flex-direction: row;
    justify-content: flex-end;
    margin-bottom: 0;
    transform: none;
  }

  .game-progress {
    display: none;
  }

  .scoreboards.single-scoreboard .scoreboard {
    width: 100%;
  }

  .game-row {
    grid-template-columns: 1fr auto;
    padding: 12px;
  }

  .player-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
