:root {
  --walnut: #3b1d19;
  --mahogany: #70402f;
  --cream: #f3e6cf;
  --paper: #e8d7bd;
  --ink: #fbf1df;
  --shadow: rgba(14, 7, 5, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 231, 190, 0.12), transparent 26rem),
    linear-gradient(135deg, #2b1514 0%, var(--walnut) 42%, var(--mahogany) 100%);
  overflow: hidden;
}

.app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.screen {
  height: 100dvh;
  min-height: 0;
  display: none;
  overflow: hidden;
}

.screen.is-active {
  display: grid;
}

.screen:not(.is-active) {
  display: none;
}

[hidden] {
  display: none !important;
}

.setup,
.profile {
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  overflow: hidden;
}

.setup-panel {
  width: min(94vw, 1080px);
  height: min-content;
  max-height: calc(100dvh - clamp(28px, 6vw, 68px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(14px, 2.2vh, 24px);
  padding: clamp(18px, 3vw, 34px);
  border: 2px solid rgba(255, 242, 214, 0.72);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.12), rgba(42, 19, 15, 0.64)),
    rgba(32, 16, 13, 0.62);
  box-shadow: 0 28px 90px var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  animation: setupIn 560ms ease-out forwards;
}

.setup-header {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.setup-subtitle {
  margin: 0;
  color: #fff7e8;
  font-size: clamp(1.55rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 8px 22px rgba(24, 10, 7, 0.66);
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2.45rem, 6.2vw, 5rem);
  font-weight: 400;
  line-height: 0.96;
  color: #fff7e8;
  text-shadow: 0 10px 28px rgba(24, 10, 7, 0.72);
}

.profile-logo,
.game-title {
  max-width: min(92%, 760px);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(2.35rem, 5.4vw, 4.45rem);
  line-height: 0.9;
  color: #fffaf0;
  -webkit-text-stroke: 1.2px rgba(35, 13, 9, 0.88);
  text-shadow:
    0 2px 0 rgba(255, 221, 150, 0.45),
    0 4px 0 rgba(60, 24, 16, 0.82),
    0 14px 30px rgba(18, 6, 4, 0.84),
    0 0 18px rgba(255, 232, 174, 0.36);
}

.game-title {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
}

.setup-grid {
  display: grid;
  gap: clamp(14px, 2vh, 20px);
  min-height: 0;
  overflow: hidden;
}

#setupScreen .setup-panel {
  position: relative;
  width: min(96vw, 1220px);
  max-height: calc(100dvh - clamp(16px, 3vw, 32px));
  gap: clamp(8px, 1.35vh, 14px);
  padding: clamp(12px, 1.8vw, 22px);
}

#setupScreen .setup-header {
  gap: 3px;
}

#setupScreen .profile-logo {
  max-width: min(92%, 720px);
  font-size: clamp(1.9rem, 4vw, 3.25rem);
}

#setupScreen .setup-subtitle {
  font-size: clamp(1.25rem, 2.8vw, 2.15rem);
}

#setupScreen .setup-player {
  font-size: 0.9rem;
}

#setupScreen .setup-grid {
  gap: clamp(8px, 1.25vh, 12px);
}

.profile-page {
  width: min(94vw, 860px);
}

#accountScreen .profile-page {
  width: min(94vw, 1220px);
  gap: clamp(6px, 1vh, 10px);
  padding: clamp(10px, 1.4vw, 18px);
}

#accountScreen .setup-header {
  gap: 0;
}

#accountScreen .profile-logo {
  font-size: clamp(1.75rem, 3.1vw, 2.85rem);
  line-height: 0.95;
}

#accountScreen .setup-subtitle {
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  line-height: 1;
}

#accountScreen .profile-panel {
  gap: 7px;
  padding: 10px;
}

#profileScreen .profile-page {
  max-height: calc(100dvh - clamp(28px, 6vw, 68px));
  overflow: visible;
}

#profileScreen .setup-panel,
#profileScreen .profile-panel,
#profileScreen .profile-form {
  overflow: visible;
}

.option-group {
  display: grid;
  gap: 10px;
}

#setupScreen .option-group h3 {
  text-align: center;
}

h3 {
  margin-bottom: 0;
  color: var(--paper);
  font-size: 1rem;
  font-weight: 700;
}

.profile-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 14px;
  background: rgba(16, 8, 6, 0.2);
}

.profile-choice,
.setup-player {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.profile-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  padding: 6px;
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 999px;
  background: rgba(16, 8, 6, 0.24);
}

.setup-player {
  align-items: center;
  color: rgba(251, 241, 223, 0.8);
  font-size: 0.95rem;
}

.play-mode-panel,
.online-panel {
  width: min(94vw, 940px);
}

.online-panel {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  max-height: calc(100dvh - clamp(16px, 3vw, 32px));
  padding: clamp(10px, 1.5vw, 18px) clamp(16px, 2vw, 24px) clamp(58px, 7vh, 72px);
}

#onlineScreen .setup-header {
  gap: 0;
}

#onlineScreen .profile-logo {
  font-size: clamp(1.8rem, 3.7vw, 3.1rem);
  line-height: 0.86;
}

#onlineScreen .setup-subtitle {
  font-size: clamp(1.35rem, 2.7vw, 2.25rem);
}

#onlineScreen .setup-player {
  font-size: 0.86rem;
}

.play-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
}

.play-mode-card,
.online-room-card,
.online-room-action {
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.play-mode-card {
  min-height: clamp(150px, 24vh, 220px);
  display: grid;
  align-content: center;
  gap: 12px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(255, 244, 222, 0.5);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.play-mode-card:hover,
.play-mode-card:focus {
  border-color: rgba(255, 244, 222, 0.9);
  outline: none;
  background: rgba(255, 247, 232, 0.14);
  transform: translateY(-1px);
}

.play-mode-title {
  color: #fff7e8;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1;
}

.play-mode-text {
  color: rgba(251, 241, 223, 0.78);
  font-size: 1rem;
  line-height: 1.35;
}

.online-room-panel {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 14px;
  background: rgba(16, 8, 6, 0.2);
  overflow: auto;
}

.online-room-list,
.online-room-group,
.online-private-panel,
.online-private-room {
  display: grid;
  gap: 10px;
}

.online-room-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.online-room-group {
  align-content: start;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255, 244, 222, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.045);
}

.online-room-group:last-child {
  padding-right: 8px;
  border-right: 1px solid rgba(255, 244, 222, 0.18);
}

.online-room-group h4 {
  margin: -2px -2px 3px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 224, 166, 0.28);
  border-radius: 8px;
  color: #ffe0a6;
  background: rgba(255, 224, 166, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.online-room-card {
  min-height: 29px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(255, 244, 222, 0.16);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.online-room-card:hover,
.online-room-card:focus,
.online-room-card.is-selected {
  border-color: rgba(255, 248, 232, 0.72);
  outline: none;
  background: rgba(255, 247, 232, 0.06);
}

.online-room-card.is-selected {
  background: rgba(255, 247, 232, 0.1);
}

.online-room-card.is-waiting {
  background: rgba(255, 224, 166, 0.1);
  border-color: rgba(255, 224, 166, 0.64);
}

.online-room-card.is-busy {
  opacity: 0.58;
}

.online-room-card > span:not(.online-room-state) {
  color: #fff7e8;
  font-size: clamp(0.96rem, 1.35vw, 1.12rem);
  font-weight: 700;
  line-height: 1;
  overflow-wrap: anywhere;
}

.online-room-card.is-selected > span:not(.online-room-state) {
  color: #ffe0a6;
}

.online-room-state {
  min-width: 72px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 244, 222, 0.28);
  border-radius: 999px;
  color: rgba(255, 247, 232, 0.7);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.online-room-card.is-waiting .online-room-state {
  border-color: rgba(255, 224, 166, 0.8);
  color: #ffe0a6;
  background: rgba(255, 224, 166, 0.13);
}

.online-room-card.is-busy .online-room-state {
  color: rgba(255, 247, 232, 0.76);
}

.online-private-panel {
  gap: 8px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(255, 224, 166, 0.28);
  border-radius: 10px;
  background: rgba(16, 8, 6, 0.24);
}

.online-private-panel h3 {
  margin: 0;
  color: #fff7e8;
  font-size: 0.98rem;
  line-height: 1;
}

.online-private-panel .profile-subtitle {
  margin-top: 3px;
}

.online-private-room {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.online-private-column {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 244, 222, 0.2);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.045);
}

.online-private-column h4 {
  margin: 0;
  color: #ffe0a6;
  font-size: 0.84rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.online-room-action {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 244, 222, 0.76);
  border-radius: 999px;
  color: var(--walnut);
  background: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
}

.online-room-action.is-secondary {
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
}

.waiting-room-note,
.waiting-invite {
  justify-self: center;
  align-self: center;
  width: min(100%, 560px);
}

.waiting-room-note {
  padding: 18px;
  border: 1px solid rgba(255, 244, 222, 0.24);
  border-radius: 8px;
  color: rgba(251, 241, 223, 0.82);
  background: rgba(16, 8, 6, 0.22);
  text-align: center;
}

.waiting-invite {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 224, 166, 0.34);
  border-radius: 8px;
  background: rgba(16, 8, 6, 0.3);
}

.waiting-invite h3 {
  margin: 0;
}

.waiting-invite h3 {
  color: #ffe0a6;
  font-size: 1rem;
}

.waiting-invite textarea {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 244, 222, 0.28);
  border-radius: 8px;
  color: #fff7e8;
  background: rgba(16, 8, 6, 0.32);
  resize: vertical;
  line-height: 1.3;
}

.copy-invite-button {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 244, 222, 0.52);
  border-radius: 999px;
  color: #fff7e8;
  background: rgba(255, 247, 232, 0.08);
  font: 700 0.95rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.copy-invite-button:hover,
.copy-invite-button:focus {
  outline: none;
  background: rgba(255, 247, 232, 0.14);
}

.online-room-action:hover,
.online-room-action:focus {
  outline: none;
  background: #fff8ea;
}

.online-status {
  min-height: 1.4em;
  margin: 0;
  color: rgba(251, 241, 223, 0.8);
  font-size: 0.92rem;
  line-height: 1.35;
}

.player-flag {
  width: 24px;
  height: 16px;
  margin-left: 2px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 244, 222, 0.42);
  vertical-align: -2px;
}

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.profile-subtitle {
  margin: 4px 0 0;
  color: rgba(251, 241, 223, 0.72);
  font-size: 0.88rem;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-field {
  position: relative;
  display: grid;
  gap: 5px;
}

.profile-field[hidden] {
  display: none;
}

.profile-field span {
  color: rgba(251, 241, 223, 0.78);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-field input,
.profile-field select {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 244, 222, 0.46);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
  font: 700 0.95rem/1 Georgia, "Times New Roman", serif;
}

.profile-field select {
  cursor: pointer;
}

.profile-field select option {
  color: #2c1710;
  background: #fff7e8;
}

.profile-field input:focus,
.profile-field select:focus {
  outline: 2px solid rgba(255, 244, 222, 0.55);
  outline-offset: 2px;
}

.profile-save,
.profile-link {
  min-width: 112px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 244, 222, 0.76);
  border-radius: 999px;
  color: var(--walnut);
  background: var(--ink);
  font: 700 0.9rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.profile-link {
  min-width: 92px;
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
}

.profile-save:disabled,
.profile-field input:disabled,
.remember-profile input:disabled + span {
  cursor: not-allowed;
  opacity: 0.48;
}

.remember-profile {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: rgba(251, 241, 223, 0.82);
  font-size: 0.92rem;
  cursor: pointer;
}

.remember-profile input {
  width: 17px;
  height: 17px;
  accent-color: var(--ink);
  cursor: pointer;
}

.profile-form-actions {
  display: flex;
  justify-content: center;
}

.profile-form-actions [hidden] {
  display: none;
}

.account-form .profile-field input[readonly] {
  cursor: default;
  opacity: 0.78;
}

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

#accountScreen .profile-panel {
  min-height: 0;
  overflow: visible;
}

#accountScreen .profile-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: visible;
  align-items: start;
}

.profile-stat {
  min-height: 64px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 244, 222, 0.28);
  border-radius: 10px;
  background: rgba(255, 247, 232, 0.07);
}

.profile-stat-record {
  min-height: 188px;
}

#accountScreen .profile-stat {
  min-height: 56px;
  gap: 4px;
  padding: 8px 10px;
}

#accountScreen .profile-stat-record {
  min-height: 104px;
}

#accountScreen .profile-stat strong {
  font-size: clamp(0.96rem, 1.6vw, 1.16rem);
}

#accountScreen .profile-stat small {
  font-size: 0.69rem;
  line-height: 1.18;
}

.profile-stat span {
  color: rgba(251, 241, 223, 0.68);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-stat strong {
  color: #fff7e8;
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1;
}

.profile-stat small {
  display: block;
  color: rgba(251, 241, 223, 0.76);
  font-size: 0.74rem;
  line-height: 1.28;
}

.option-row,
.difficulty-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#setupScreen .card-type-row {
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 999px;
  background: rgba(16, 8, 6, 0.24);
}

.option-card,
.difficulty,
.profile-mode,
.play-button {
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.option-card {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 244, 222, 0.46);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

#setupScreen .option-card {
  min-height: 42px;
  gap: 4px;
  padding: 0 18px;
  border-color: transparent;
  border-radius: 999px;
  text-align: center;
}

#setupScreen .option-card.is-selected {
  border-color: rgba(255, 248, 232, 0.96);
}

.option-card:hover,
.difficulty:hover,
.profile-mode:hover {
  border-color: rgba(255, 244, 222, 0.88);
  background: rgba(255, 247, 232, 0.14);
}

.option-card.is-selected,
.difficulty.is-selected,
.profile-mode.is-selected {
  border-color: rgba(255, 248, 232, 0.96);
  color: var(--walnut);
  background: var(--ink);
}

.option-title {
  font-size: clamp(1.16rem, 2.6vw, 1.56rem);
  font-weight: 700;
}

#setupScreen .option-title {
  font-size: clamp(1.02rem, 2vw, 1.28rem);
}

.option-text {
  color: rgba(251, 241, 223, 0.78);
  font-size: 0.94rem;
  line-height: 1.35;
}

#setupScreen .option-text {
  display: none;
}

.option-card.is-selected .option-text {
  color: rgba(59, 29, 25, 0.72);
}

.difficulty-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 999px;
  background: rgba(16, 8, 6, 0.24);
}

.difficulty,
.profile-mode {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 0.98rem;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

#setupScreen .difficulty {
  min-height: 42px;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
}

.profile-mode {
  min-width: 0;
  padding: 0 16px;
  line-height: 1.08;
  white-space: normal;
}

.difficulty {
  position: relative;
}

.difficulty::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(255, 244, 222, 0.72);
  border-radius: 10px;
  color: var(--walnut);
  background: var(--ink);
  box-shadow: 0 10px 24px rgba(24, 11, 8, 0.34);
  font-size: 0.82rem;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.difficulty:hover::after,
.difficulty:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.difficulty-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#setupScreen .option-group[aria-labelledby="difficultyTitle"] {
  grid-column: 1 / -1;
  justify-self: center;
  width: 100%;
}

#setupScreen .option-group[aria-labelledby="difficultyTitle"] .difficulty-row {
  width: 100%;
}

.setup-corner-actions {
  position: absolute;
  right: clamp(12px, 1.8vw, 22px);
  bottom: clamp(12px, 1.8vw, 22px);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (min-width: 900px) {
  #setupScreen .setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  #setupScreen .option-group:first-child {
    grid-column: 1 / -1;
  }
}

.play-button {
  justify-self: center;
  min-width: min(100%, 230px);
  min-height: 48px;
  padding: 0 30px;
  border: 1px solid rgba(255, 244, 222, 0.84);
  border-radius: 999px;
  color: var(--walnut);
  background: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(24, 11, 8, 0.32);
  transition: background 160ms ease, transform 160ms ease;
}

#setupScreen .play-button {
  min-height: 42px;
}

.play-button:hover {
  background: #fff8ea;
  transform: translateY(-1px);
}

.game {
  place-items: center;
  padding: clamp(8px, 1.4vw, 18px);
  overflow: hidden;
}

.game-shell {
  position: relative;
  --board-max-height: calc(100dvh - 230px);
  width: min(98vw, 1280px);
  height: calc(100dvh - clamp(16px, 2.8vw, 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(5px, 0.8vh, 10px);
  padding: clamp(8px, 1.3vw, 14px);
  border: 2px solid rgba(255, 242, 214, 0.72);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.1), rgba(42, 19, 15, 0.6)),
    rgba(32, 16, 13, 0.66);
  box-shadow: 0 28px 90px var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  animation: setupIn 560ms ease-out forwards;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.game-title,
.game-choice {
  margin: 0;
}

.game-title {
  margin: 0;
}

.game-choice {
  margin-top: 2px;
  color: rgba(251, 241, 223, 0.78);
  font-size: 0.92rem;
}

.back-button {
  min-width: 92px;
  min-height: 34px;
  padding: 0 18px;
  border: 1px solid rgba(255, 244, 222, 0.62);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
  font: 700 0.95rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.back-button:hover {
  border-color: rgba(255, 244, 222, 0.88);
  background: rgba(255, 247, 232, 0.14);
}

.score-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.score-card {
  min-height: 36px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 244, 222, 0.38);
  border-radius: 12px;
  background: rgba(255, 247, 232, 0.08);
}

.score-card.is-current {
  color: var(--walnut);
  background: var(--ink);
}

.score-label {
  color: rgba(251, 241, 223, 0.7);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.score-card.is-current .score-label {
  color: rgba(59, 29, 25, 0.66);
}

.score-card strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1;
}

.memory-board {
  align-self: center;
  justify-self: center;
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: clamp(5px, 0.85vw, 10px);
}

.memory-board.is-waiting-turn .memory-card:not(.is-open):not(.is-matched) {
  cursor: wait;
  opacity: 0.72;
}

.memory-board[data-size="large"] {
  width: min(100%, 1120px);
}

.memory-board[data-columns="4"][data-rows="4"] {
  width: min(100%, var(--board-max-height), 820px);
}

.memory-board[data-columns="8"][data-rows="4"] {
  width: min(100%, calc(var(--board-max-height) * 2), 1220px);
}

.memory-board[data-columns="12"][data-rows="4"] {
  width: min(100%, calc(var(--board-max-height) * 3), 1240px);
}

.memory-board[data-columns="8"][data-rows="8"] {
  width: min(100%, var(--board-max-height), 980px);
}

.memory-board[data-columns="12"][data-rows="6"] {
  width: min(100%, calc(var(--board-max-height) * 2), 1240px);
}

.memory-board[data-columns="12"][data-rows="6"] .memory-card:nth-last-child(4) {
  grid-column-start: 5;
}

.memory-card {
  position: relative;
  aspect-ratio: 1;
  min-height: 0;
  border: 1px solid rgba(255, 244, 222, 0.58);
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  font-family: Georgia, "Times New Roman", serif;
}

.card-back,
.card-front {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 11px;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 240ms ease;
}

.card-back {
  background:
    linear-gradient(45deg, rgba(255, 242, 214, 0.12) 25%, transparent 25% 50%, rgba(255, 242, 214, 0.12) 50% 75%, transparent 75%),
    linear-gradient(145deg, #4b241d, #7b4934);
  background-size: 28px 28px, auto;
  color: rgba(255, 247, 232, 0.88);
  font-size: clamp(2rem, 5vw, 3.7rem);
  text-shadow: 0 8px 18px rgba(24, 10, 7, 0.62);
}

.card-front {
  transform: rotateY(180deg);
  background: var(--ink);
  color: var(--walnut);
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name-card {
  width: 100%;
  height: 100%;
  padding: clamp(4px, 0.8vw, 10px);
  font-size: clamp(0.62rem, 1.65vw, 1.35rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.memory-card:disabled {
  cursor: default;
}

.memory-card.is-open .card-back,
.memory-card.is-preview-open .card-back,
.memory-card.is-matched .card-back {
  transform: rotateY(180deg);
}

.memory-card.is-open .card-front,
.memory-card.is-preview-open .card-front,
.memory-card.is-matched .card-front {
  transform: rotateY(360deg);
}

.memory-card.is-matched {
  border-color: rgba(255, 248, 232, 0.96);
  box-shadow: 0 0 0 2px rgba(255, 232, 174, 0.26);
}

.memory-card.is-matched .card-front {
  filter: saturate(0.88);
}

.result-panel {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(21, 9, 7, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.result-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.result-dialog {
  width: min(92vw, 520px);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(22px, 4vw, 34px);
  border: 2px solid rgba(255, 242, 214, 0.76);
  border-radius: 18px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.14), rgba(42, 19, 15, 0.72)),
    rgba(45, 21, 16, 0.94);
  box-shadow: 0 28px 70px rgba(14, 7, 5, 0.52);
  text-align: center;
}

.result-kicker,
.result-summary {
  margin: 0;
}

.result-kicker {
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.result-dialog h2 {
  font-size: clamp(2rem, 7vw, 3.8rem);
}

.result-summary {
  color: rgba(251, 241, 223, 0.84);
  font-size: 1.05rem;
  line-height: 1.35;
}

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

.result-button {
  min-width: 138px;
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid rgba(255, 244, 222, 0.84);
  border-radius: 999px;
  color: var(--walnut);
  background: var(--ink);
  font: 700 0.95rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.result-button.is-secondary {
  color: var(--ink);
  background: rgba(255, 247, 232, 0.08);
}

.info-page {
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  overflow: hidden;
}

.info-page-panel {
  width: min(100%, 900px);
  grid-template-rows: auto minmax(0, 1fr);
}

.info-back-button {
  min-height: 32px;
  padding: 0 18px;
}

.info-page.is-biographies {
  padding: clamp(8px, 1.5vw, 16px);
  overflow: hidden;
}

.info-page.is-biographies .info-page-panel {
  width: min(100%, 1500px);
  height: calc(100dvh - clamp(16px, 3vw, 32px));
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(14px, 2.2vh, 24px);
  padding: clamp(18px, 3vw, 34px);
  overflow: hidden;
}

.info-page.is-leaderboards {
  align-items: center;
  padding: clamp(14px, 3vw, 34px);
}

.info-page.is-leaderboards .info-page-panel {
  width: min(100%, 1380px);
  max-height: calc(100dvh - clamp(28px, 6vw, 68px));
}

.info-page.is-leaderboards .info-article {
  padding: 8px;
}

.info-page.is-photo-credits {
  align-items: center;
  padding: clamp(14px, 3vw, 34px);
}

.info-page.is-photo-credits .info-page-panel {
  width: min(100%, 1500px);
  max-height: calc(100dvh - clamp(28px, 6vw, 68px));
}

.info-page.is-photo-credits .info-article {
  padding: 8px;
}

.info-page.is-biographies .info-article {
  min-height: 0;
  padding: clamp(8px, 1.2vw, 12px);
  overflow: hidden;
}

.info-article {
  display: grid;
  gap: 12px;
  min-height: 0;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 14px;
  color: rgba(251, 241, 223, 0.86);
  background: rgba(16, 8, 6, 0.2);
}

.info-article[hidden] {
  display: none;
}

.info-article h3,
.info-article h4,
.info-article p,
.info-article ol,
.info-article ul {
  margin: 0;
}

.info-article h3 {
  color: #fff7e8;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.info-article h4 {
  color: #ffe0a6;
  font-size: 1.05rem;
}

.info-article p,
.info-article li {
  font-size: 1rem;
  line-height: 1.45;
}

.info-article ol,
.info-article ul {
  display: grid;
  gap: 6px;
  padding-left: 1.25rem;
}

.info-article a {
  color: #ffe0a6;
  text-underline-offset: 3px;
}

.biography-layout {
  display: grid;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}

.biography-list {
  align-self: center;
  justify-self: center;
  width: min(100%, 1420px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(5px, 0.65vw, 9px);
  overflow: visible;
  padding: 0;
}

.biography-list[hidden],
.biography-reader[hidden] {
  display: none;
}

.biography-card {
  position: relative;
  display: grid;
  place-items: stretch;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 244, 222, 0.58);
  border-radius: 12px;
  color: var(--walnut);
  background: var(--ink);
  font: 700 clamp(0.58rem, 0.9vw, 0.78rem)/1 Georgia, "Times New Roman", serif;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(14, 7, 5, 0.16);
}

.biography-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.biography-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 4px 5px;
  color: var(--walnut);
  background: rgba(251, 241, 223, 0.88);
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .online-room-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-room-group:nth-child(2n) {
    padding-right: 0;
    border-right: 0;
  }

  .biography-list {
    width: min(100%, 980px);
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.biography-card:hover,
.biography-card:focus {
  border-color: rgba(255, 248, 232, 0.96);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 232, 174, 0.26);
}

.biography-reader {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding: 2px 8px 2px 0;
}

.biography-back {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 224, 166, 0.82);
  border-radius: 8px;
  color: #fff7e8;
  background: rgba(255, 224, 166, 0.12);
  font: 700 0.9rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.biography-back:hover,
.biography-back:focus {
  outline: none;
  background: rgba(255, 224, 166, 0.2);
}

.credits-list,
.credits-grid {
  display: grid;
  gap: 8px;
}

.credits-note {
  margin: 0;
  color: rgba(251, 241, 223, 0.84);
  font-size: 0.84rem;
  line-height: 1.25;
}

.credits-grid {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.credit-item {
  position: relative;
  display: grid;
  place-items: stretch;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(255, 244, 222, 0.58);
  border-radius: 12px;
  color: var(--walnut);
  background: var(--ink);
  font: 700 clamp(0.58rem, 0.9vw, 0.78rem)/1 Georgia, "Times New Roman", serif;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(14, 7, 5, 0.16);
}

.credit-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.credit-item strong {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 22px;
  display: grid;
  place-items: center;
  padding: 3px 4px;
  color: var(--walnut);
  background: rgba(251, 241, 223, 0.88);
  overflow-wrap: anywhere;
}

.credit-item span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff7e8;
  background: rgba(28, 13, 10, 0.86);
  font-size: clamp(0.58rem, 0.8vw, 0.74rem);
  line-height: 1.18;
  opacity: 0;
  transition: opacity 160ms ease;
}

.credit-item:hover,
.credit-item:focus {
  border-color: rgba(255, 248, 232, 0.96);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 232, 174, 0.26);
}

.credit-item:hover span,
.credit-item:focus span {
  opacity: 1;
}

.credits-reader {
  display: grid;
  gap: 12px;
  padding: 4px 8px 2px 0;
}

.credits-reader h3,
.credits-reader p {
  margin: 0;
}

.credits-reader p {
  user-select: text;
}

.leaderboards-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: 8px;
}

.leaderboard-section {
  display: grid;
  gap: 5px;
  min-height: 0;
  padding: 8px;
  border: 1px solid rgba(255, 244, 222, 0.28);
  border-radius: 8px;
  background: rgba(255, 247, 232, 0.07);
}

.leaderboard-section h3 {
  margin: 0;
  color: #fff7e8;
  font-size: 0.96rem;
}

.leaderboard-table {
  display: grid;
  gap: 4px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1.5fr) minmax(48px, 0.62fr) minmax(42px, 0.52fr);
  gap: 6px;
  align-items: center;
  min-height: 22px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(16, 8, 6, 0.16);
}

.leaderboard-head {
  color: rgba(251, 241, 223, 0.66);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
}

.leaderboard-row span,
.leaderboard-row strong,
.leaderboard-row button,
.leaderboard-empty {
  color: rgba(251, 241, 223, 0.84);
  font-size: 0.74rem;
  line-height: 1.15;
}

.leaderboard-row strong,
.leaderboard-row button {
  color: #fff7e8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row button {
  width: 100%;
  padding: 0;
  border: 0;
  color: #fff7e8;
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.leaderboard-row button:hover,
.leaderboard-row button:focus {
  color: #ffe0a6;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.leaderboard-empty {
  margin: 0;
  padding: 8px;
}

.leaderboard-profile {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 224, 166, 0.5);
  border-radius: 8px;
  background: rgba(16, 8, 6, 0.2);
}

.leaderboard-profile-head,
.leaderboard-profile-details,
.leaderboard-profile-records {
  display: grid;
  gap: 8px;
}

.leaderboard-profile-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.leaderboard-profile-head h3 {
  margin: 0;
}

.leaderboard-profile-head button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 244, 222, 0.42);
  border-radius: 999px;
  color: #fff7e8;
  background: rgba(255, 247, 232, 0.08);
  font: 700 0.82rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}

.leaderboard-profile-details,
.leaderboard-profile-records {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.leaderboard-profile-details div,
.leaderboard-profile-record {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255, 247, 232, 0.07);
}

.leaderboard-profile-details span,
.leaderboard-profile-record span,
.leaderboard-profile-record small {
  color: rgba(251, 241, 223, 0.72);
  font-size: 0.74rem;
}

.leaderboard-profile-details strong,
.leaderboard-profile-record strong {
  color: #fff7e8;
  font-size: 0.95rem;
}

.project-links {
  position: fixed;
  top: 50%;
  left: clamp(10px, 2vw, 28px);
  z-index: 12;
  width: min(180px, 18vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
}

.project-links a,
.project-links button,
.side-player-label {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 244, 222, 0.5);
  border-radius: 999px;
  color: rgba(251, 241, 223, 0.84);
  background: rgba(16, 8, 6, 0.34);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(14, 7, 5, 0.2);
  cursor: pointer;
}

.side-player-label {
  color: #fff7e8;
  cursor: default;
}

.project-links a:hover,
.project-links a:focus,
.project-links button:hover,
.project-links button:focus {
  border-color: rgba(255, 244, 222, 0.82);
  color: #fff7e8;
  outline: none;
  background: rgba(255, 247, 232, 0.1);
}

.project-links #playFromInfoButton {
  display: none;
  border-color: rgba(90, 192, 128, 0.72);
  color: #f0fff5;
  background: rgba(28, 105, 61, 0.62);
}

.info-page.screen.is-active ~ .project-links #playFromInfoButton,
#accountScreen.screen.is-active ~ .project-links #playFromInfoButton {
  display: inline-grid;
}

.project-links #sideProfileButton {
  border-color: rgba(255, 224, 166, 0.72);
  color: #fff7e8;
  background: rgba(255, 224, 166, 0.1);
}

.project-links #sideProfileButton[hidden] {
  display: none;
}

@media (min-width: 900px) {
  .setup.screen.is-active,
  .profile.screen.is-active,
  .info-page.screen.is-active {
    padding-left: clamp(210px, 13vw, 250px);
  }

  .setup.screen.is-active .setup-panel,
  .profile.screen.is-active .setup-panel,
  .info-page.screen.is-active .setup-panel {
    width: min(100%, 1220px);
  }

  .info-page.screen.is-active .info-page-panel {
    width: min(100%, 900px);
  }

  .info-page.screen.is-active.is-biographies .info-page-panel {
    width: min(100%, 1500px);
  }

  .info-page.screen.is-active.is-leaderboards .info-page-panel {
    width: min(100%, 1380px);
  }

  .info-page.screen.is-active.is-photo-credits .info-page-panel {
    width: min(100%, 1500px);
  }

  .profile.screen.is-active .profile-page {
    width: min(100%, 860px);
  }

  .game.screen.is-active {
    padding-left: clamp(210px, 13vw, 250px);
  }

  .game.screen.is-active .game-shell {
    width: min(100%, 1280px);
  }

  .game.screen.is-active ~ .project-links,
  .setup.screen.is-active ~ .project-links,
  .profile.screen.is-active ~ .project-links {
    left: clamp(12px, 1.4vw, 22px);
    width: clamp(142px, 10.5vw, 168px);
    gap: 8px;
  }

  .game.screen.is-active ~ .project-links a,
  .setup.screen.is-active ~ .project-links a,
  .profile.screen.is-active ~ .project-links a,
  .game.screen.is-active ~ .project-links button,
  .setup.screen.is-active ~ .project-links button,
  .profile.screen.is-active ~ .project-links button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.84rem;
    line-height: 1.05;
  }
}

@media (max-width: 899px) {
  .setup.screen.is-active ~ .project-links,
  .profile.screen.is-active ~ .project-links,
  .game.screen.is-active ~ .project-links {
    display: none;
  }
}

.intro.screen.is-active ~ .project-links {
  display: none;
}

@keyframes setupIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .setup-panel {
    border-radius: 16px;
  }

  h2 {
    font-size: clamp(2rem, 10vw, 3.4rem);
  }

  .setup-subtitle {
    font-size: clamp(1.35rem, 7vw, 2.4rem);
  }

  .option-row,
  .difficulty-row {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }

  .profile-head,
  .profile-form {
    grid-template-columns: 1fr;
  }

  .profile-head {
    display: grid;
  }

  .biography-layout {
    grid-template-columns: 1fr;
  }

  .biography-list,
  .biography-reader {
    max-height: none;
  }

  .profile-save {
    justify-self: start;
  }

  .profile-actions {
    justify-content: start;
  }

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

  .play-mode-grid,
  .online-room-list,
  .online-room-group,
  .online-private-panel,
  .online-private-room {
    grid-template-columns: 1fr;
  }

  .difficulty,
  .profile-mode,
  .profile-choice {
    border-radius: 12px;
  }

  .online-room-group {
    padding-right: 0;
    padding-bottom: 8px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 244, 222, 0.22);
  }

  .online-room-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .game-shell {
    border-radius: 16px;
  }

  .project-links {
    position: fixed;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 50%;
    width: min(94vw, 980px);
    flex-flow: row wrap;
    justify-content: center;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
  }

  .setup,
  .profile,
  .info-page {
    padding-bottom: clamp(74px, 18vh, 112px);
  }

  .intro.screen.is-active ~ .project-links {
    display: none;
  }

}

@media (max-height: 700px) and (min-width: 900px) {
  .game-shell {
    --board-max-height: calc(100dvh - 178px);
    gap: 5px;
    padding: 8px;
  }

  .game-header {
    gap: 10px;
  }

  .game-title {
    font-size: clamp(1.25rem, 2.3vw, 1.85rem);
  }

  .game-choice {
    font-size: 0.78rem;
  }

  .back-button {
    min-height: 30px;
    padding: 0 14px;
    font-size: 0.86rem;
  }

  .score-panel {
    gap: 6px;
  }

  .score-card {
    min-height: 30px;
    gap: 1px;
    padding: 5px 9px;
  }

  .score-card strong {
    font-size: 1rem;
  }

  .memory-board[data-columns="8"][data-rows="8"] {
    width: min(100%, var(--board-max-height), 900px);
  }

  .info-page.is-biographies .profile-logo {
    font-size: clamp(1.45rem, 3.2vw, 2.35rem);
  }

  .info-page.is-biographies .setup-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.55rem);
  }

  .info-page.is-biographies .info-article {
    padding: 8px;
  }

  .biography-list {
    width: min(100%, 1380px);
  }

  .biography-card {
    border-radius: 10px;
  }

  .biography-card span {
    min-height: 20px;
    padding: 3px 4px;
    font-size: clamp(0.52rem, 0.82vw, 0.68rem);
  }
}
