@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/press-start-2p-cyrillic-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #120e0c;
  --bg-2: #1c1511;
  --panel: #241a15;
  --panel-2: #2e221c;
  --ink: #efe6d4;
  --muted: #a89880;
  --gold: #d4b05a;
  --gold-2: #f0d48a;
  --red: #c44532;
  --green: #7cb86a;
  --secret: #8bd17c;
  --super: #c9a0e8;
  --ultra: #e07070;
  --line: #3d2f26;
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(1200px 700px at 50% -10%, #3a2418 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
}

.noise,
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.noise {
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scanlines {
  opacity: 0.07;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, 0.35) 2px 3px
  );
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

h1, h2 {
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

button {
  font-family: inherit;
}

.screen {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 40px;
  overflow: hidden;
}

.menu-screen {
  justify-content: center;
  gap: 8px;
  padding: 40px 24px;
}

.menu-screen .brand {
  margin-bottom: 36px;
}

.menu-screen .brand small {
  font-size: 22px;
  letter-spacing: 0.32em;
}

.menu-screen .brand h1 {
  font-size: clamp(56px, 9vw, 92px);
  margin-top: 14px;
}

body.on-menu {
  background:
    radial-gradient(ellipse 70% 45% at 50% 12%, rgba(196, 140, 48, 0.22), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 115%, rgba(72, 16, 12, 0.55), transparent 58%),
    radial-gradient(1200px 700px at 50% -10%, #3a2418 0%, transparent 55%),
    #0c0806;
}

.menu-home {
  position: relative;
  overflow: hidden;
}

.menu-glow {
  position: absolute;
  inset: -10% 0 auto;
  height: 48%;
  background: radial-gradient(ellipse at 50% 0%, rgba(232, 176, 72, 0.16), transparent 68%);
  pointer-events: none;
}

.menu-plaque {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  padding: 42px 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(92, 58, 28, 0.5), transparent 58%),
    linear-gradient(180deg, #3d2a1c 0%, #261910 52%, #16100c 100%);
  border: 3px solid #d4b06a;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 170, 0.28),
    inset 0 0 0 5px #2a1c12,
    inset 0 0 0 7px #8a6230,
    0 0 0 3px #1a120c,
    14px 16px 0 #000,
    0 0 90px rgba(196, 140, 48, 0.16);
}

.menu-rivet {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d48a, #a07030 55%, #4a3010);
  box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255, 240, 200, 0.7);
}

.menu-rivet.tl { top: 12px; left: 12px; }
.menu-rivet.tr { top: 12px; right: 12px; }
.menu-rivet.bl { bottom: 12px; left: 12px; }
.menu-rivet.br { bottom: 12px; right: 12px; }

.menu-portrait {
  width: 104px;
  height: 104px;
  margin-bottom: 8px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 230, 180, 0.14), transparent 62%),
    #140e0a;
  border: 3px solid #c4a06a;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 2px #2a1c14,
    0 0 22px rgba(212, 176, 90, 0.2);
  overflow: hidden;
}

.portrait-rim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  image-rendering: pixelated;
  z-index: 1;
}

.menu-portrait.is-framed,
.friend-face.is-framed {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #140e0a;
  overflow: hidden;
}

.menu-portrait img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  background: transparent;
}

.menu-portrait.is-framed img,
.friend-face.is-framed img,
.avatar-pick.is-framed img {
  width: 62%;
  height: 62%;
}

.menu-home .menu-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.menu-home .menu-brand::after {
  content: "";
  display: block;
  width: 72%;
  height: 2px;
  margin: 16px auto 0;
  background: linear-gradient(90deg, transparent, #8a6230 12%, #e0c070 50%, #8a6230 88%, transparent);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
}

.menu-home .menu-brand small {
  display: block;
  padding: 4px 8px 0;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-transform: uppercase;
  color: #ffe7a0;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    1px 0 0 #140a06,
    -1px 0 0 #140a06,
    0 1px 0 #140a06,
    0 -1px 0 #140a06,
    1px 1px 0 #140a06,
    -1px 1px 0 #140a06,
    1px -1px 0 #140a06,
    -1px -1px 0 #140a06,
    2px 3px 0 #4a140c;
}

.mode-pick .menu-brand h1 {
  margin-top: 6px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(36px, 6vw, 52px);
  letter-spacing: 0.12em;
  color: #f3d78a;
  text-shadow:
    0 0 0 #3a2208,
    3px 4px 0 #000,
    0 0 24px rgba(232, 184, 72, 0.35);
}

.menu-home .menu-brand .menu-title {
  margin-top: 22px;
  padding: 4px 6px 2px;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
  color: #fff0b4;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    2px 0 0 #140a06,
    -2px 0 0 #140a06,
    0 2px 0 #140a06,
    0 -2px 0 #140a06,
    2px 2px 0 #140a06,
    -2px 2px 0 #140a06,
    2px -2px 0 #140a06,
    -2px -2px 0 #140a06,
    3px 5px 0 #4a140c,
    0 0 22px rgba(232, 176, 64, 0.4);
}

.menu-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 14px 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #1a1008;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border: 2px solid #6a4818;
  box-shadow: 3px 3px 0 #000, inset 0 1px 0 rgba(255, 248, 220, 0.65);
}

.menu-badge.menu-dlc {
  display: block;
  margin-top: 6px;
  padding: 4px 4px 2px;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.4;
  color: #ffd24a;
  background: none;
  border: none;
  box-shadow: none;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    1px 0 0 #140a06,
    -1px 0 0 #140a06,
    0 1px 0 #140a06,
    0 -1px 0 #140a06,
    1px 1px 0 #140a06,
    -1px 1px 0 #140a06,
    1px -1px 0 #140a06,
    -1px -1px 0 #140a06,
    2px 3px 0 #6a1010;
}

@media (min-width: 700px) {
  .menu-home .menu-brand small,
  .menu-badge.menu-dlc {
    font-size: 16px;
  }
  .menu-title {
    font-size: 36px;
    margin-top: 26px;
  }
  .menu-main .menu-brand small,
  .menu-main .menu-badge.menu-dlc {
    font-size: 16px;
  }
  .menu-main .menu-brand .menu-title {
    font-size: 36px;
    margin-top: 18px;
  }
}

.menu-relics {
  display: flex;
  gap: 14px;
  margin: 2px 0 18px;
}

.menu-relics .legend-icon {
  width: 40px;
  height: 40px;
  overflow: hidden;
}

.menu-home .legend-icon {
  overflow: hidden;
}

.menu-home .legend-icon .minimap-icon {
  --icon: 22px;
}

.play-btn {
  width: min(760px, 100%);
  padding: 52px 36px;
  font-size: clamp(44px, 6vw, 64px);
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff6e8;
  background: #6a3a22;
  border: 4px solid #a06038;
  box-shadow: 10px 10px 0 #000;
  cursor: pointer;
}

.play-btn:hover,
.play-btn:focus-visible {
  border-color: var(--gold);
  transform: translate(-2px, -2px);
  outline: none;
}

.menu-home .play-btn {
  width: 100%;
  padding: 28px 24px;
  font-size: clamp(28px, 4.2vw, 42px);
  color: #fff4d4;
  background:
    linear-gradient(180deg, #8a4e28 0%, #5a3018 55%, #3e2010 100%);
  border: 4px solid #e0c070;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 180, 0.28),
    inset 0 -3px 0 rgba(0, 0, 0, 0.35),
    8px 8px 0 #000,
    0 0 24px rgba(212, 160, 64, 0.18);
  text-shadow: 0 3px 0 #000;
}

.menu-home .play-btn:hover,
.menu-home .play-btn:focus-visible {
  border-color: #fff0b8;
  color: #fffaf0;
  transform: translate(-2px, -2px);
}

.menu-home .play-btn:active {
  transform: translate(3px, 3px);
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.35),
    4px 4px 0 #000;
}

.menu-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-btn {
  position: relative;
  width: 100%;
  padding: 16px 20px;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(18px, 2.6vw, 24px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a 0%, #c09038 55%, #8a6420 100%);
  border: 3px solid #f8e4a0;
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 220, 0.55),
    inset 0 -3px 0 rgba(80, 48, 8, 0.35),
    8px 8px 0 #000,
    0 0 20px rgba(212, 176, 80, 0.22);
  text-shadow: 0 1px 0 rgba(255, 248, 220, 0.45);
  cursor: pointer;
}

.profile-btn:hover,
.profile-btn:focus-visible {
  border-color: #fff8d8;
  color: #140c06;
  transform: translate(-2px, -2px);
  outline: none;
}

.profile-btn:active {
  transform: translate(3px, 3px);
  box-shadow:
    inset 0 2px 0 rgba(80, 48, 8, 0.35),
    4px 4px 0 #000;
}

.menu-who {
  width: 100%;
  margin: 0;
  padding: 6px 0 0;
  text-align: center;
  font-family: "Pixelify Sans", "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 26px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: #ffe7a0;
  text-shadow:
    2px 0 0 #140a06,
    -2px 0 0 #140a06,
    0 2px 0 #140a06,
    0 -2px 0 #140a06,
    2px 2px 0 #140a06,
    -2px 2px 0 #140a06,
    2px -2px 0 #140a06,
    -2px -2px 0 #140a06,
    3px 4px 0 #4a140c;
}

.menu-logout {
  margin-top: 12px;
  background: transparent;
  border-color: #6a5030;
  box-shadow: none;
  opacity: 0.85;
}

.menu-logout:hover,
.menu-logout:focus-visible {
  opacity: 1;
}

.lang-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.lang-btn {
  min-height: 46px;
  padding: 10px 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #efe0c4;
  background: linear-gradient(180deg, #2e2218, #1a140f);
  border: 3px solid #8a6a3c;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12), 4px 4px 0 #000;
  cursor: pointer;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.lang-btn.active {
  color: #1a1008;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border-color: #6a4818;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 220, 0.65),
    4px 4px 0 #000;
}

.menu-main .menu-plaque {
  width: min(920px, 100%);
  padding: 32px 30px 26px;
  align-items: stretch;
  background:
    radial-gradient(ellipse at 14% 22%, rgba(140, 84, 32, 0.38), transparent 46%),
    radial-gradient(ellipse at 88% 0%, rgba(92, 58, 28, 0.4), transparent 52%),
    linear-gradient(180deg, #4a3220 0%, #2c1c12 50%, #120c08 100%);
}

.menu-main-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 8px 34px;
  align-items: center;
  width: 100%;
}

.menu-main-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 8px 0 4px;
}

.menu-main .menu-portrait {
  width: 140px;
  height: 140px;
  margin: 0;
  padding: 0;
}

.menu-main .menu-portrait.is-framed {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: #140e0a;
}

.menu-main .menu-portrait.is-framed img {
  width: 62%;
  height: 62%;
}

.menu-main .menu-relics {
  margin: 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #6a4e2c;
  box-shadow: inset 0 0 0 1px rgba(212, 176, 90, 0.1), 3px 3px 0 #000;
}

.menu-main-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 4px 42px 0 0;
}

.menu-main .menu-brand {
  align-items: flex-start;
  width: 100%;
  margin-bottom: 14px;
  text-align: left;
}

.menu-main .menu-brand::after {
  display: none;
}

.menu-main .menu-brand small {
  padding: 0;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-transform: uppercase;
  color: #ffe7a0;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    1px 0 0 #140a06,
    -1px 0 0 #140a06,
    0 1px 0 #140a06,
    0 -1px 0 #140a06,
    1px 1px 0 #140a06,
    -1px 1px 0 #140a06,
    1px -1px 0 #140a06,
    -1px -1px 0 #140a06,
    2px 3px 0 #4a140c;
}

.menu-main .menu-badge.menu-dlc {
  display: block;
  margin: 6px 0 0;
  padding: 4px 4px 2px;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1.4;
  color: #ffd24a;
  background: none;
  border: none;
  box-shadow: none;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    1px 0 0 #140a06,
    -1px 0 0 #140a06,
    0 1px 0 #140a06,
    0 -1px 0 #140a06,
    1px 1px 0 #140a06,
    -1px 1px 0 #140a06,
    1px -1px 0 #140a06,
    -1px -1px 0 #140a06,
    2px 3px 0 #6a1010;
}

.menu-main .menu-brand .menu-title {
  margin-top: 14px;
  padding: 4px 6px 2px;
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
  color: #fff0b4;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    2px 0 0 #140a06,
    -2px 0 0 #140a06,
    0 2px 0 #140a06,
    0 -2px 0 #140a06,
    2px 2px 0 #140a06,
    -2px 2px 0 #140a06,
    2px -2px 0 #140a06,
    -2px -2px 0 #140a06,
    3px 5px 0 #4a140c,
    0 0 22px rgba(232, 176, 64, 0.4);
}

.menu-main .menu-who {
  width: 100%;
  max-width: 210px;
  margin: 0;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}

.menu-main .menu-actions {
  gap: 10px;
}

.menu-main .play-btn {
  padding: 18px 20px;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.18em;
}

.menu-main .profile-btn {
  padding: 13px 18px;
  font-size: clamp(16px, 2.2vw, 20px);
}

.menu-main-foot {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
}

.menu-main .lang-switch {
  flex: 1;
  margin-top: 0;
}

.menu-main .menu-logout {
  margin-top: 0;
  padding: 0 16px;
  border: 3px solid #8a6a3c;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12), 4px 4px 0 #000;
  opacity: 1;
}

.auth-choice {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-choice .play-btn {
  font-size: clamp(20px, 3vw, 28px);
  padding: 18px 16px;
}

.auth-choice .hint,
.auth-form .hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.35;
  color: #cbb48a;
  text-align: center;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  position: relative;
}

.autofill-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.auth-field label {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cbb48a;
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 10px 12px;
  color: #fff4d4;
  font-size: 16px;
  background: #16100c;
  border: 2px solid #8a6a3c;
  box-shadow: inset 2px 2px 0 #000;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: none;
  border-color: var(--gold);
}

.auth-error {
  min-height: 1.3em;
  font-size: 13px;
  line-height: 1.35;
  color: #e07070;
}

.auth-form .auth-notice {
  min-height: 1.2em;
  margin: 0;
  text-align: center;
  color: #c8e0a8;
  font-size: 13px;
}

.auth-switch {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #efe0c4;
}

.account-bar strong {
  color: #f3d78a;
}

.hud-sfx {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 8px;
}

.hud-sfx .sfx-control {
  width: 100%;
}

.sfx-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 168px;
  height: 38px;
  padding: 0 10px 0 8px;
  color: #f0d48a;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 230, 180, 0.16), transparent 62%),
    linear-gradient(180deg, #3a2a20, #18110d);
  border: 2px solid #c4a06a;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.28),
    inset 0 0 0 1px #2a1c14,
    3px 3px 0 #000;
}

.sfx-control:hover,
.sfx-control:focus-within {
  color: #fff6e0;
  border-color: #fff0b8;
}

.sfx-control.is-off {
  color: #e07070;
  border-color: #c44532;
  background:
    radial-gradient(circle at 50% 28%, rgba(224, 80, 70, 0.22), transparent 62%),
    linear-gradient(180deg, #3a1c18, #160c0a);
}

.sfx-mute {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  flex-shrink: 0;
  color: inherit;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
}

.sfx-mute:hover,
.sfx-mute:focus-visible {
  color: #fff6e0;
  outline: none;
}

.sfx-control.is-off .sfx-mute:hover,
.sfx-control.is-off .sfx-mute:focus-visible {
  color: #ff9088;
}

.sfx-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.sfx-slider {
  flex: 1;
  min-width: 0;
  height: 16px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.sfx-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(180deg, #2a1c14, #140c08);
  border: 1px solid #8a6230;
  box-shadow: inset 0 1px 0 #000;
}

.sfx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  background: linear-gradient(180deg, #fff0b8, #c4a06a);
  border: 1px solid #3a2010;
  box-shadow: 1px 1px 0 #000;
}

.sfx-slider::-moz-range-track {
  height: 6px;
  background: linear-gradient(180deg, #2a1c14, #140c08);
  border: 1px solid #8a6230;
}

.sfx-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: linear-gradient(180deg, #fff0b8, #c4a06a);
  border: 1px solid #3a2010;
  box-shadow: 1px 1px 0 #000;
}

.menu-sfx {
  position: absolute;
  top: 22px;
  right: 34px;
  z-index: 3;
}

.menu-sfx .sfx-control {
  width: 176px;
  height: 40px;
}

.logout-btn {
  padding: 6px 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #efe0c4;
  background: #2a1c14;
  border: 2px solid #8a6a3c;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.logout-btn:hover,
.logout-btn:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.record-list {
  width: 100%;
  margin: 0 0 16px;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  color: #d8c8a8;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid #6a4e2c;
}

.record-list h3 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbb48a;
}

.record-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.record-list b {
  color: #f3d78a;
}

.mode-pick .menu-plaque {
  width: min(720px, 100%);
}

.mode-pick .menu-brand {
  margin-bottom: 22px;
}

.mode-info .menu-plaque {
  width: min(560px, 100%);
  padding: 28px 26px 20px;
  align-items: stretch;
}

.mode-info .menu-brand {
  margin-bottom: 4px;
  text-align: center;
}

.mode-info .menu-brand h1 {
  margin: 8px auto 0;
  max-width: 14em;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: #f3d78a;
  text-shadow:
    0 0 0 #3a2208,
    3px 4px 0 #000,
    0 0 24px rgba(232, 184, 72, 0.35);
}

.mode-rules-today {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  color: #f3d78a;
  letter-spacing: 0.04em;
}

.mode-info .daily-timer {
  margin: 12px 0 0;
  padding: 10px 12px 8px;
}

.mode-info .daily-timer-label {
  font-size: 11px;
}

.mode-info .daily-timer-value {
  font-size: clamp(18px, 3vw, 28px);
}

.mode-help-btns {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0 0;
}

.mode-help-btns.is-pair {
  grid-template-columns: 1fr 1fr;
}

.mode-help-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  padding: 14px 8px 12px;
  color: #efe0c4;
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 160, 0.08), transparent 62%),
    linear-gradient(180deg, #2c2018, #16100c);
  border: 2px solid #8a6a3c;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.14),
    4px 4px 0 #000;
  cursor: pointer;
}

.mode-help-tile strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
  text-align: center;
}

.mode-help-tile .legend-icon {
  width: 40px;
  height: 40px;
}

.mode-help-tile .legend-icon .minimap-icon {
  --icon: 24px;
}

.mode-help-tile:hover,
.mode-help-tile:focus-visible {
  border-color: #f0d48a;
  color: #fff6e0;
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.22),
    5px 5px 0 #000,
    0 0 16px rgba(212, 160, 64, 0.18);
}

.mode-help-tile:active {
  transform: translate(2px, 2px);
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.35),
    2px 2px 0 #000;
}

.mode-info-rule {
  width: 78%;
  height: 2px;
  margin: 18px auto 16px;
  background: linear-gradient(90deg, transparent, #8a6230 12%, #e0c070 50%, #8a6230 88%, transparent);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
}

.mode-help-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  padding: 40px 38px 32px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(92, 58, 28, 0.45), transparent 58%),
    linear-gradient(180deg, #3d2a1c 0%, #241810 55%, #16100c 100%);
  border: 3px solid #d4b06a;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 170, 0.28),
    inset 0 0 0 5px #2a1c12,
    inset 0 0 0 7px #8a6230,
    0 0 0 3px #1a120c,
    12px 14px 0 #000,
    0 0 70px rgba(196, 140, 48, 0.16);
}

.modal.mode-help-dialog {
  padding: 40px 38px 32px;
}

.modal.mode-help-dialog[data-help="rules"],
.modal.mode-help-dialog[data-help="score"],
.modal.mode-help-dialog[data-help="keys"] {
  width: min(680px, 100%);
  max-height: none;
  overflow: visible;
  padding: 40px 38px 32px;
}

.modal.mode-help-dialog[data-help="rules"] {
  width: min(760px, 100%);
}

.mode-help-head {
  text-align: center;
  margin: 4px 0 18px;
  padding-bottom: 16px;
  background-image: linear-gradient(90deg, transparent, #8a6230 12%, #e0c070 50%, #8a6230 88%, transparent);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: bottom;
}

.mode-help-dialog h2 {
  margin: 0 auto;
  max-width: 16em;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #f3d78a;
  text-shadow: 2px 3px 0 #000, 0 0 18px rgba(232, 184, 72, 0.28);
}

.mode-help-dialog h3 {
  margin: 18px 0 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e0c070;
  text-align: center;
}

.mode-help-body {
  display: grid;
  gap: 10px;
}

.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.help-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #5a4030;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.08);
}

.help-step-n {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: 700;
  color: #1a1008;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border: 1px solid #6a4818;
  box-shadow: 2px 2px 0 #000;
}

.help-steps p {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: #f3ead8;
}

.help-notes {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.help-notes p {
  margin: 0;
  padding: 14px 16px;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: #f3ead8;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #5a4030;
}

.help-scores,
.help-keys {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.help-scores {
  grid-auto-rows: 1fr;
  align-items: stretch;
}

.help-keys {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.help-score-row,
.help-score-note,
.help-keys li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #5a4030;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.08);
  color: #f3ead8;
  font-size: 18px;
  line-height: 1.4;
}

.help-score-row,
.help-score-note {
  min-height: 88px;
  height: 100%;
}

.help-keys li {
  min-height: 54px;
}

.help-score-label {
  flex: 1;
  min-width: 8em;
  letter-spacing: 0.01em;
}

.help-score-pts {
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f3d78a;
  text-shadow: 2px 2px 0 #000;
}

.help-score-unit {
  color: #cbb48a;
  font-size: 15px;
}

.help-score-note {
  color: #e4d4b8;
  font-size: 17px;
  line-height: 1.5;
}

.help-score-note .help-score-pts {
  font-size: 18px;
  margin: 0 4px;
}

.help-keys span {
  font-size: 18px;
  letter-spacing: 0.01em;
}

.help-keys kbd {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 18px;
  font-weight: 700;
  color: #fff4d4;
  background: linear-gradient(180deg, #4a3426, #241810);
  border: 2px solid #c4a06a;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.28),
    2px 3px 0 #000;
}

.help-kbd-wide {
  min-width: 108px;
  letter-spacing: 0.06em;
  font-size: 14px;
}

.help-key-check {
  margin-top: 4px;
}

.mode-help-dialog .legend-icon {
  width: 38px;
  height: 38px;
}

.mode-help-dialog .legend-icon .minimap-icon {
  --icon: 24px;
}

.mode-help-close {
  width: 100%;
  margin-top: 18px;
  padding: 14px 16px;
  font-family: "Courier New", Courier, monospace;
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff4d4;
  background: linear-gradient(180deg, #8a4e28 0%, #5a3018 55%, #3e2010 100%);
  border: 3px solid #e0c070;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 180, 0.28),
    5px 5px 0 #000;
  cursor: pointer;
}

.mode-help-close:hover,
.mode-help-close:focus-visible {
  border-color: #fff0b8;
  outline: none;
}

.daily-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  padding: 16px 18px 14px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 176, 72, 0.16), transparent 70%),
    rgba(0, 0, 0, 0.32);
  border: 3px solid #e0c070;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.22),
    5px 5px 0 #000;
}

.daily-timer-label {
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe7a0;
  text-align: center;
  text-shadow: 2px 2px 0 #140a06;
}

.daily-timer-value {
  font-family: "Press Start 2P", "Courier New", Courier, monospace;
  font-size: clamp(22px, 5.2vw, 42px);
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: #ffe7a0;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-shadow:
    2px 0 0 #140a06,
    -2px 0 0 #140a06,
    0 2px 0 #140a06,
    0 -2px 0 #140a06,
    3px 4px 0 #4a140c,
    0 0 16px rgba(232, 176, 64, 0.35);
}

.daily-timer-btn {
  margin: 2px 0 0;
  padding: 8px 10px 6px;
  width: min(100%, 420px);
  gap: 6px;
}

.daily-timer-btn .daily-timer-label {
  font-size: 12px;
}

.daily-timer-btn .daily-timer-value {
  font-size: clamp(16px, 3.4vw, 26px);
}

.daily-timer-hud {
  margin: 8px 0 12px;
  padding: 10px 8px 8px;
  width: 100%;
  gap: 6px;
}

.hud .daily-timer-hud {
  margin: clamp(4px, 0.6vh, 10px) 0;
  padding: clamp(6px, 0.8vh, 10px) 8px;
  flex-shrink: 0;
}

.daily-timer-hud .daily-timer-label {
  font-size: 11px;
}

.daily-timer-hud .daily-timer-value {
  font-size: clamp(16px, 1.6vw, 20px);
}

.mode-btn.mode-daily {
  min-height: 128px;
  padding-top: 18px;
  padding-bottom: 16px;
  gap: 8px;
}

.mode-info-actions {
  display: grid;
  gap: 8px;
  width: 100%;
}

.mode-info .play-btn {
  padding: 14px 16px;
  font-size: clamp(18px, 2.6vw, 26px);
}

.mode-info-back {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  min-height: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #cbb48a;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.mode-info-back:hover,
.mode-info-back:focus-visible {
  color: #f3d78a;
  outline: none;
}

.mode-list {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 16px 12px;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #efe0c4;
  background: linear-gradient(180deg, #2e2218, #1a140f);
  border: 3px solid #8a6a3c;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12), 5px 5px 0 #000;
  cursor: pointer;
}

.mode-btn strong {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 700;
}

.mode-btn span {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #a89068;
}

.mode-btn.mode-featured {
  grid-column: 1 / -1;
  min-height: 88px;
}

.mode-btn.mode-featured strong {
  font-size: clamp(20px, 3vw, 28px);
}

.mode-btn.mode-ready {
  color: #fff4d4;
  background:
    linear-gradient(180deg, #8a4e28 0%, #5a3018 55%, #3e2010 100%);
  border: 3px solid #e0c070;
  box-shadow:
    inset 0 2px 0 rgba(255, 232, 180, 0.28),
    inset 0 -3px 0 rgba(0, 0, 0, 0.35),
    6px 6px 0 #000,
    0 0 18px rgba(212, 160, 64, 0.18);
  text-shadow: 0 2px 0 #000;
}

.mode-btn.mode-ready:hover,
.mode-btn.mode-ready:focus-visible {
  border-color: #fff0b8;
  color: #fffaf0;
  outline: none;
  transform: translate(-2px, -2px);
}

.mode-btn.mode-ready:active {
  transform: translate(2px, 2px);
  box-shadow:
    inset 0 2px 0 rgba(0, 0, 0, 0.35),
    3px 3px 0 #000;
}

.mode-btn.mode-locked {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.08), 4px 4px 0 #000;
}

.mode-pick .help-btn.mode-back {
  width: 100%;
  margin-top: 16px;
  min-height: 52px;
  padding: 12px 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(15px, 2vw, 18px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #efe0c4;
}

.menu-home .help-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 10px;
  min-height: 108px;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #efe0c4;
  background: linear-gradient(180deg, #2e2218, #1a140f);
  border: 3px solid #8a6a3c;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12), 5px 5px 0 #000;
}

.menu-home .help-btn:hover,
.menu-home .help-btn:focus-visible {
  border-color: #f0d48a;
  color: #fff6e0;
}

.report-dialog {
  padding: 36px 34px 28px;
}

.report-dialog .report-label {
  display: block;
  margin: 12px 0 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d8c090;
}

.report-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-reason {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0d8a0;
  background: #16100c;
  border: 2px solid #6a4e2c;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.report-reason input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.report-reason:has(input:checked) {
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border-color: #f8e4a0;
}

.report-dialog textarea {
  width: 100%;
  min-height: 110px;
  margin: 0 0 8px;
  padding: 12px 14px;
  resize: vertical;
  font: inherit;
  color: #efe0c4;
  background: #140e0a;
  border: 2px solid #8a6a3c;
  box-shadow: inset 0 0 0 1px #2a1c14, 3px 3px 0 #000;
}

.report-dialog textarea:focus {
  border-color: #e8c878;
  outline: none;
}

.report-actions {
  width: 100%;
}

.quit-modal .modal-actions,
.skip-modal .modal-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.seed-pick-screen .brand p {
  margin-top: 12px;
  max-width: 720px;
  color: var(--muted, #c9b8a4);
  font-size: 18px;
}

.seed-pick-list {
  width: min(760px, 100%);
  display: grid;
  gap: 10px;
}

.seed-pick-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  color: var(--ink);
  background: var(--bg-2);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 #000;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
}

.seed-pick-item strong {
  font-size: 22px;
  letter-spacing: 0.12em;
}

.seed-pick-item span {
  font-size: 15px;
  opacity: 0.8;
}

.seed-pick-item:hover,
.seed-pick-item:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.seed-pick-actions {
  width: min(760px, 100%);
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.seed-pick-random {
  padding: 22px 24px;
  font-size: clamp(22px, 3vw, 32px);
}

.help-btn {
  background: var(--bg-2);
  border: 3px solid var(--line);
  box-shadow: 5px 5px 0 #000;
  padding: 22px 16px;
  color: var(--ink);
  cursor: pointer;
  font-size: clamp(16px, 1.8vw, 26px);
  min-height: 76px;
}

.help-btn:hover,
.help-btn:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.menu-modal {
  width: min(820px, 100%);
  padding: 36px;
}

.menu-modal h2 {
  font-size: 32px;
  margin-bottom: 16px;
}

.menu-modal p,
.menu-modal li {
  font-size: 20px;
  line-height: 1.55;
}

.menu-modal .btn {
  font-size: 20px;
  padding: 14px 18px;
}

.inspect-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  height: 48px;
  padding: 0 8px;
}

.inspect-stage {
  flex: 1;
  min-height: 0;
  display: flex;
}

.inspect-preview {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 18%, #2a2018, #0e0a08 72%);
  border: 3px solid #c4a06a;
  box-shadow: inset 0 0 0 4px #1a120c;
  color: var(--gold-2);
  font-size: 22px;
  text-align: center;
  overflow: hidden;
}

.inspect-close {
  flex-shrink: 0;
  min-width: 140px;
  height: 36px;
  padding: 0 18px;
  border: 3px solid #c4a06a;
  background: linear-gradient(180deg, #3a2a1c, #1a120c);
  color: #f0d48a;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #000, inset 0 1px 0 rgba(255, 232, 180, 0.25);
}

.inspect-close:hover,
.inspect-close:focus-visible {
  border-color: #fff0b8;
  color: #fffaf0;
  outline: none;
}

.room-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.inspect-preview span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.brand {
  text-align: center;
  margin-bottom: 28px;
}

.brand small {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.28em;
}

.brand h1 {
  font-size: clamp(28px, 5vw, 48px);
  margin-top: 8px;
  text-shadow: 0 3px 0 #000, 0 0 18px rgba(212, 176, 90, 0.25);
}

.brand p {
  max-width: 640px;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.5;
}

.game-screen {
  --cell: clamp(26px, min(3.4vw, 4.2vh), 38px);
  --gap: calc(var(--cell) * 0.24);
  padding: 16px 12px 24px;
  justify-content: center;
}

.game-screen:has(.game-wrap) {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  padding: 8px 10px;
  overflow: hidden;
}

.panel, .legend, .hud {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 #000;
}

.game-wrap {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns:
    minmax(280px, min(22vw, 400px))
    minmax(0, 1fr)
    minmax(260px, min(20vw, 380px));
  gap: 12px;
  align-items: stretch;
}

.hud,
.legend {
  padding: clamp(12px, 1.4vh, 18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hud h2,
.legend h2 {
  font-size: clamp(18px, 2.2vh, 24px);
  color: var(--gold);
  margin-bottom: clamp(6px, 0.8vh, 12px);
  flex-shrink: 0;
}

.meta {
  display: grid;
  gap: clamp(4px, 0.55vh, 8px);
  font-size: clamp(15px, 1.7vh, 18px);
  color: var(--muted);
  flex-shrink: 0;
}

.meta b {
  color: var(--ink);
}

.hud-practice {
  color: #e8a090;
  font-size: 13px;
}

.tools {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vh, 10px);
  margin: clamp(8px, 1vh, 14px) 0;
  flex-shrink: 0;
}

.guess-tools {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vh, 10px);
  margin: clamp(8px, 1vh, 14px) 0 2px;
  flex-shrink: 0;
}

.guess-plaque {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: clamp(8px, 1.1vh, 12px) 12px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font-size: clamp(14px, 1.6vh, 17px);
  line-height: 1.2;
  background: linear-gradient(180deg, #32241d, #1c1410);
  border: 2px solid #8a6a40;
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 180, 0.18),
    4px 4px 0 #000;
}

.guess-plaque .legend-icon {
  width: clamp(34px, 3.6vh, 42px);
  height: clamp(34px, 3.6vh, 42px);
}

.guess-plaque .minimap-icon {
  --icon: clamp(22px, 2.6vh, 28px);
}

.guess-plaque:hover,
.guess-plaque:focus-visible {
  border-color: var(--gold);
  outline: none;
}

.guess-plaque.active[data-tool="secret"] {
  background: linear-gradient(180deg, #2a4028, #162016);
  border-color: var(--secret);
  box-shadow: inset 0 1px 0 rgba(180, 255, 170, 0.2), 4px 4px 0 #000, 0 0 12px rgba(123, 184, 106, 0.25);
}

.guess-plaque.active[data-tool="super"] {
  background: linear-gradient(180deg, #3a2848, #1a1020);
  border-color: var(--super);
  box-shadow: inset 0 1px 0 rgba(220, 180, 255, 0.2), 4px 4px 0 #000, 0 0 12px rgba(201, 160, 232, 0.25);
}

.guess-plaque.active[data-tool="ultra"] {
  background: linear-gradient(180deg, #4a1c1c, #201010);
  border-color: var(--ultra);
  box-shadow: inset 0 1px 0 rgba(255, 170, 160, 0.2), 4px 4px 0 #000, 0 0 12px rgba(224, 112, 112, 0.25);
}

.guess-plaque.active[data-tool="delirium"] {
  background: linear-gradient(180deg, #4a3a18, #201808);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 230, 160, 0.22), 4px 4px 0 #000, 0 0 12px rgba(212, 176, 90, 0.28);
}

.guess-plaque .guess-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  opacity: 0.82;
  font-size: clamp(13px, 1.5vh, 16px);
}

.btn {
  border: 2px solid var(--line);
  background: #3a2a22;
  color: var(--ink);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #000;
  font-size: 16px;
}

.game-screen .btn {
  padding: clamp(9px, 1.2vh, 14px) 12px;
  font-size: clamp(15px, 1.7vh, 18px);
}

.btn:hover {
  border-color: var(--gold);
}

.btn.primary {
  background: #6a3a22;
  border-color: #a06038;
  color: #fff6e8;
}

.btn.danger {
  background: #4a1e18;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.45;
}

.map-stage {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 10px 10px;
  overflow: hidden;
}

.floor-title {
  flex-shrink: 0;
  margin-bottom: 6px;
  text-align: center;
}

.floor-title h2 {
  font-size: 18px;
  color: var(--gold-2);
}

.map-board {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: grid;
  place-items: center;
  container-type: size;
}

.map {
  --span: 13;
  --gap-ratio: 0.22;
  --cell: calc(min(100cqw, 100cqh) / (var(--span) + (var(--span) - 1) * var(--gap-ratio)));
  --gap: calc(var(--cell) * var(--gap-ratio));
  position: relative;
  flex-shrink: 0;
  background: #070504;
}

.isaac-room {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

.isaac-room-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.isaac-room-sprite {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  image-rendering: pixelated;
  filter: brightness(1.15) contrast(1.05);
  pointer-events: none;
}

.isaac-room-sprite.shape-1 { background-image: url("../isaac/map/shapes/1.png"); }
.isaac-room-sprite.shape-2 { background-image: url("../isaac/map/shapes/2.png"); }
.isaac-room-sprite.shape-3 { background-image: url("../isaac/map/shapes/3.png"); }
.isaac-room-sprite.shape-4 { background-image: url("../isaac/map/shapes/4.png"); }
.isaac-room-sprite.shape-5 { background-image: url("../isaac/map/shapes/5.png"); }
.isaac-room-sprite.shape-6 { background-image: url("../isaac/map/shapes/6.png"); }
.isaac-room-sprite.shape-7 { background-image: url("../isaac/map/shapes/7.png"); }
.isaac-room-sprite.shape-8 { background-image: url("../isaac/map/shapes/8.png"); }
.isaac-room-sprite.shape-9 { background-image: url("../isaac/map/shapes/9.png"); }
.isaac-room-sprite.shape-10 { background-image: url("../isaac/map/shapes/10.png"); }
.isaac-room-sprite.shape-11 { background-image: url("../isaac/map/shapes/11.png"); }
.isaac-room-sprite.shape-12 { background-image: url("../isaac/map/shapes/12.png"); }

.isaac-room.thin-h,
.isaac-room.thin-v {
  overflow: hidden;
}

.isaac-room.clip-ltl { clip-path: polygon(50% 0, 100% 0, 100% 100%, 0 100%, 0 50%, 50% 50%); }
.isaac-room.clip-ltr { clip-path: polygon(0 0, 50% 0, 50% 50%, 100% 50%, 100% 100%, 0 100%); }
.isaac-room.clip-lbl { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 100%, 50% 50%, 0 50%); }
.isaac-room.clip-lbr { clip-path: polygon(0 0, 100% 0, 100% 50%, 50% 50%, 50% 100%, 0 100%); }

.isaac-room.reveal-hit::after,
.isaac-room.reveal-miss::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  border-radius: 2px;
}

.isaac-room.reveal-hit::after {
  background: rgba(72, 210, 96, 0.26);
  box-shadow: inset 0 0 0 2px rgba(120, 255, 150, 0.45);
}

.isaac-room.reveal-miss::after {
  background: rgba(220, 48, 40, 0.26);
  box-shadow: inset 0 0 0 2px rgba(255, 110, 90, 0.45);
}

.isaac-room.guess-pick::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: rgba(240, 212, 138, 0.14);
  box-shadow: inset 0 0 0 3px #f0d48a;
}

.map.boss-hunt .isaac-room {
  cursor: pointer;
}

.minimap-icon {
  --icon: calc(var(--cell, 48px) * 0.84);
  width: var(--icon);
  height: var(--icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 3;
}

.isaac-room > .minimap-icon {
  --icon: calc(var(--cell, 48px) * 0.68);
}

.legend-icon .minimap-icon {
  --icon: clamp(18px, 2.2vh, 26px);
}

.legend .minimap-icon {
  --icon: clamp(20px, 2.4vh, 28px);
}

.legend-icon {
  width: clamp(28px, 3.2vh, 38px);
  height: clamp(28px, 3.2vh, 38px);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 230, 180, 0.16), transparent 62%),
    linear-gradient(180deg, #3a2a20, #18110d);
  border: 2px solid #c4a06a;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.28),
    inset 0 0 0 1px #2a1c14,
    2px 2px 0 #000;
}

.icon-arcade { background-image: url("../isaac/map/icons/Arcade.png"); }
.icon-bedroom { background-image: url("../isaac/map/icons/Bedroom.png"); }
.icon-bosschallenge { background-image: url("../isaac/map/icons/Boss Challenge Room.png"); }
.icon-boss { background-image: url("../isaac/map/icons/Boss Room.png"); }
.icon-challenge { background-image: url("../isaac/map/icons/Challenge Room.png"); }
.icon-curse { background-image: url("../isaac/map/icons/Curse Room.png"); }
.icon-dice { background-image: url("../isaac/map/icons/Dice Room.png"); }
.icon-library { background-image: url("../isaac/map/icons/libary.png"); }
.icon-miniboss { background-image: url("../isaac/map/icons/Mini-Boss Room.png"); }
.icon-planetarium { background-image: url("../isaac/map/icons/Planetarium.png"); }
.icon-sacrifice { background-image: url("../isaac/map/icons/Sacrifice Rooms.png"); }
.icon-secret { background-image: url("../isaac/map/icons/secret.png"); }
.icon-shop { background-image: url("../isaac/map/icons/shop.png"); }
.start-label {
  position: relative;
  z-index: 3;
  font-family: Tahoma, "Segoe UI", sans-serif;
  font-size: max(8px, calc(var(--cell, 38px) * 0.22));
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #111;
  text-transform: uppercase;
  pointer-events: none;
}

.legend-icon:has(.start-label) {
  width: auto;
  min-width: clamp(32px, 3.6vh, 44px);
  padding: 0 4px;
}

.legend-icon .start-label {
  font-size: clamp(9px, 1.15vh, 12px);
  letter-spacing: -0.03em;
  color: #111;
  text-shadow: none;
}
.icon-super { background-image: url("../isaac/map/icons/supersecret.png"); }
.icon-treasure { background-image: url("../isaac/map/icons/treasure.png"); }
.icon-ultra { background-image: url("../isaac/map/icons/Ultra Secret.png"); }
.icon-vault { background-image: url("../isaac/map/icons/Vault.png"); }
.icon-angel { background-image: url("../isaac/map/icons/Planetarium.png"); }
.icon-devil { background-image: url("../isaac/map/icons/Curse Room.png"); }

.cell,
.ghost {
  width: var(--cell, 48px);
  height: var(--cell, 48px);
  border-radius: 3px;
}

.cell {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.cell .ghost {
  pointer-events: auto;
}

.ghost {
  border: 2px dashed #5a4a3c;
  background: rgba(80, 60, 45, 0.18);
  cursor: pointer;
  appearance: none;
  padding: 0;
}

.ghost:hover {
  background: rgba(212, 176, 90, 0.18);
  border-color: var(--gold);
}

.marker {
  position: absolute;
  inset: 3px;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 4;
  border-radius: 4px;
}

.marker .minimap-icon {
  --icon: calc(var(--cell, 48px) * 0.78);
}

.marker.wrong {
  outline: 2px solid var(--red);
  background: rgba(196, 69, 50, 0.18);
}

.door {
  position: absolute;
  background: #b4a57a;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 0 1px #5a4c38;
}

.door.h {
  width: var(--gap, 8px);
  height: calc(var(--cell, 48px) * 0.28);
  top: calc(var(--cell, 48px) / 2 - var(--cell, 48px) * 0.14);
  right: calc(-1 * var(--gap, 8px));
}

.door.v {
  width: calc(var(--cell, 48px) * 0.28);
  height: var(--gap, 8px);
  left: calc(var(--cell, 48px) / 2 - var(--cell, 48px) * 0.14);
  bottom: calc(-1 * var(--gap, 8px));
}

.legend-item {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: clamp(3px, 0.45vh, 7px) 4px;
  color: var(--muted);
  font-size: clamp(14px, 1.55vh, 17px);
  border-bottom: 1px solid #3d2f26;
  box-shadow: 0 1px 0 rgba(212, 176, 90, 0.08);
  flex: 1 1 0;
  min-height: 0;
}

.legend-item:last-child {
  border-bottom: 0;
  box-shadow: none;
  padding-bottom: 2px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 5, 0.72);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(520px, 100%);
  background: var(--panel);
  border: 2px solid var(--gold);
  box-shadow: 8px 8px 0 #000;
  padding: 22px;
}

.modal.inspect-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(78vw, 1180px);
  height: min(78vh, 760px);
  max-width: none;
  max-height: 78vh;
  padding: 16px 18px 18px;
  gap: 10px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(92, 58, 28, 0.45), transparent 58%),
    linear-gradient(180deg, #3d2a1c 0%, #241810 55%, #16100c 100%);
  border: 3px solid #d4b06a;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 170, 0.28),
    inset 0 0 0 5px #2a1c12,
    inset 0 0 0 7px #8a6230,
    0 0 0 3px #1a120c,
    12px 14px 0 #000,
    0 0 70px rgba(196, 140, 48, 0.16);
}

.inspect-rivet {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f0d48a, #a07030 55%, #4a3010);
  box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255, 240, 200, 0.7);
  pointer-events: none;
}

.inspect-rivet.tl { top: 12px; left: 12px; }
.inspect-rivet.tr { top: 12px; right: 12px; }
.inspect-rivet.bl { bottom: 12px; left: 12px; }
.inspect-rivet.br { bottom: 12px; right: 12px; }

.modal h2 {
  color: var(--gold-2);
  margin-bottom: 10px;
}

.modal p, .modal li {
  color: var(--muted);
  line-height: 1.5;
}

.modal ul {
  margin: 10px 0 16px 18px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice-screen {
  gap: 22px;
}

.choice-screen .brand h1 {
  font-size: clamp(36px, 5vw, 56px);
}

.choice-screen .brand p {
  font-size: 18px;
  max-width: 760px;
}

.warning-box {
  width: min(860px, 100%);
  background: #3a1c14;
  border: 2px solid var(--red);
  box-shadow: 4px 4px 0 #000;
  padding: 18px 20px;
  color: #f0d4c8;
  line-height: 1.5;
  font-size: 18px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  width: min(920px, 100%);
}

.choice-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.12),
    8px 8px 0 #000;
  color: var(--ink);
  padding: 22px 20px 20px;
  cursor: pointer;
  text-align: center;
}

.choice-card:hover,
.choice-card:focus-visible {
  outline: none;
  transform: translate(-2px, -2px);
}

.choice-card h3 {
  margin: 10px 0 6px;
  color: var(--gold-2);
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  font-size: 18px;
}

.choice-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

.choice-art {
  display: grid;
  place-items: center;
  min-height: 260px;
  margin: 0 auto 8px;
  background: transparent;
}

.choice-art img {
  max-width: 260px;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  background: transparent;
}

.theme-polaroid {
  background: linear-gradient(180deg, #3e3428, #221a12);
  border-color: #d8c490;
}

.theme-polaroid:hover,
.theme-polaroid:focus-visible {
  border-color: #fff0c4;
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.2), 8px 8px 0 #000, 0 0 22px rgba(232, 200, 120, 0.22);
}

.theme-negative {
  background: linear-gradient(180deg, #2c1218, #12080c);
  border-color: #8a3848;
}

.theme-negative:hover,
.theme-negative:focus-visible {
  border-color: #e07080;
  box-shadow: inset 0 1px 0 rgba(255, 160, 170, 0.16), 8px 8px 0 #000, 0 0 22px rgba(180, 40, 60, 0.28);
}

.theme-angel {
  background: linear-gradient(180deg, #2c2a36, #16141c);
  border-color: #e6d6a0;
}

.theme-angel:hover,
.theme-angel:focus-visible {
  border-color: #fff6d0;
  box-shadow: inset 0 1px 0 rgba(255, 244, 210, 0.22), 8px 8px 0 #000, 0 0 26px rgba(232, 214, 140, 0.28);
}

.theme-devil {
  background: linear-gradient(180deg, #2a1010, #100808);
  border-color: #a03030;
}

.theme-devil:hover,
.theme-devil:focus-visible {
  border-color: #e05040;
  box-shadow: inset 0 1px 0 rgba(255, 120, 90, 0.16), 8px 8px 0 #000, 0 0 26px rgba(180, 30, 24, 0.32);
}

.choice-void {
  background:
    radial-gradient(ellipse 60% 50% at 50% 42%, rgba(96, 40, 160, 0.28), transparent 70%);
}

.void-hero {
  display: grid;
  place-items: center;
}

.void-hero img {
  width: 260px;
  height: 260px;
  image-rendering: pixelated;
  background: transparent;
  filter: drop-shadow(0 0 28px rgba(150, 80, 220, 0.5));
}

.void-actions {
  width: min(640px, 100%);
}

.theme-void-yes {
  border-color: #8a58c8;
}

.theme-void-yes:hover,
.theme-void-yes:focus-visible {
  border-color: #d0a8ff;
  box-shadow: inset 0 1px 0 rgba(210, 170, 255, 0.18), 8px 8px 0 #000, 0 0 22px rgba(130, 60, 200, 0.32);
}

.theme-void-no {
  border-color: #6a5848;
}

.art-frame {
  height: 120px;
  margin: 0 auto 8px;
  border: 2px solid #000;
}

.alt-frame {
  background:
    radial-gradient(circle at 50% 30%, #6ec8e8, transparent 55%),
    linear-gradient(180deg, #1a3048, #0c1824);
}

.normal-frame {
  background:
    radial-gradient(circle at 50% 80%, #8a4a28, transparent 50%),
    linear-gradient(180deg, #3a2a18, #1a120c);
}

.results-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: min(1100px, 100%);
  justify-items: center;
}

.results-wrap.daily-results {
  justify-items: stretch;
}

.congrats-plaque {
  position: relative;
  width: min(640px, 100%);
  padding: 38px 36px 30px;
  text-align: center;
}

.daily-results .congrats-plaque {
  width: 100%;
}

.congrats-plaque h2 {
  margin: 0 0 12px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: 0.06em;
  color: #f3d78a;
  text-shadow: 2px 3px 0 #000;
}

.congrats-perfect {
  margin: 0 0 10px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

.congrats-summary {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: #efe0c4;
}

.congrats-lines {
  list-style: none;
  margin: 18px auto 0;
  padding: 14px 16px;
  width: min(460px, 100%);
  display: grid;
  gap: 8px;
  text-align: left;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 160, 0.08), transparent 64%),
    linear-gradient(180deg, rgba(28, 20, 14, 0.72), rgba(14, 10, 8, 0.55));
  border: 2px solid #6a4e2c;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.1),
    4px 4px 0 #000;
}

.congrats-line {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 6px;
}

.congrats-line .legend-icon {
  width: 36px;
  height: 36px;
}

.congrats-line .legend-icon .minimap-icon {
  --icon: 22px;
}

.congrats-line-dash {
  color: #8a7050;
  font-size: 18px;
}

.congrats-line-label {
  color: #efe0c4;
  font-size: 17px;
  line-height: 1.25;
}

.congrats-line-count {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: #f3d78a;
  text-shadow: 1px 2px 0 #000;
}

.congrats-line.is-full .congrats-line-count {
  color: #d8f0a8;
}

.congrats-line.is-miss .congrats-line-count,
.congrats-line.is-miss .congrats-line-label {
  color: #a09078;
}

.congrats-score {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.45;
}

.congrats-score b {
  color: #f3d78a;
}

.congrats-plaque .tools {
  margin-top: 22px;
}

.daily-board-screen {
  width: min(920px, 100%);
  margin: 0 auto;
}

.daily-banners {
  width: min(920px, 100%);
  margin: 0 auto 12px;
  text-align: center;
}

.daily-stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 36px 34px 28px;
  text-align: left;
}

.daily-you {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px 18px;
  align-items: stretch;
  padding: 16px 18px;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(232, 184, 72, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(28, 20, 14, 0.78), rgba(12, 8, 6, 0.62));
  border: 2px solid #8a6230;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.12),
    4px 4px 0 #000;
}

.daily-you .congrats-lines {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}

.daily-you-score {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.daily-you-score span {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b8a078;
}

.daily-you-score b {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #f3d78a;
  text-shadow: 2px 3px 0 #000;
}

.daily-you-score i {
  font-style: normal;
  font-size: 0.48em;
  color: #cbb48a;
  text-shadow: 1px 2px 0 #000;
}

.daily-you-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(212, 176, 106, 0.28);
}

.daily-you-rank {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(24px, 4vw, 34px);
  font-style: normal;
  color: #ffe7a0;
  text-shadow: 1px 2px 0 #000;
}

.daily-you-better {
  margin: 0;
  max-width: 18em;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 17px;
  line-height: 1.35;
  color: #efe0c4;
}

.daily-you-better.is-wait {
  color: #a89880;
  font-size: 15px;
}

.daily-board-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.daily-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.daily-board-head h2 {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(22px, 3.4vw, 30px);
  letter-spacing: 0.04em;
  color: #f3d78a;
  text-shadow: 1px 2px 0 #000;
}

.daily-board-tabs {
  margin: 0;
}

.daily-board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.daily-board-row {
  display: grid;
  grid-template-columns: 3.2em minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #5a4028;
  box-shadow: inset 0 0 0 1px rgba(20, 10, 6, 0.28);
}

.daily-board-row em {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-style: normal;
  font-size: 20px;
  color: #d4b878;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
}

.daily-board-row b {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 20px;
  color: #f0d8a0;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.daily-board-who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.daily-board-tags {
  display: inline-flex;
  gap: 6px;
}

.daily-board-tags i {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8c878;
}

.daily-board-tags i.is-friend {
  color: #b8d090;
}

.daily-board-row.is-you {
  background: rgba(212, 160, 64, 0.16);
  border-color: #c4a06a;
}

.daily-board-row.is-gold em { color: #ffe28a; }
.daily-board-row.is-silver em { color: #d8d8e0; }
.daily-board-row.is-bronze em { color: #d8a078; }

.daily-board-empty {
  margin: 8px 0 0;
  color: #cbb48a;
  line-height: 1.4;
}

.daily-stage-tools {
  margin-top: 4px;
  justify-content: center;
}

.daily-board-panel .history-pager {
  margin-top: 4px;
}

.board {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.board th, .board td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.board th {
  color: var(--gold);
  font-size: 15px;
}

.board tr.you td {
  background: rgba(212, 160, 64, 0.16);
  color: #fff4d4;
}

.board td.rank {
  width: 3.2em;
  color: var(--gold);
}

.board th.pct,
.board td.pct {
  width: 4.2em;
  text-align: right;
  white-space: nowrap;
}

.board i {
  font-style: normal;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.board-nick {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #f0d8a0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.board-nick:hover,
.board-nick:focus-visible {
  color: #fff8dc;
}

.leaderboard-plaque {
  text-align: left;
}

.leaderboard-plaque h2 {
  text-align: center;
}

.leaderboard-plaque .board {
  margin-top: 16px;
}

.mode-btn.mode-ready span {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #e0c070;
}

@media (max-height: 720px) {
  .hud,
  .legend {
    padding: 8px 10px;
  }

  .hud h2,
  .legend h2 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .meta {
    gap: 2px;
    font-size: 14px;
  }

  .guess-tools,
  .tools {
    gap: 5px;
    margin: 6px 0;
  }

  .guess-plaque {
    padding: 6px 10px;
    font-size: 13px;
  }

  .guess-plaque .legend-icon {
    width: 30px;
    height: 30px;
  }

  .game-screen .btn {
    padding: 7px 10px;
    font-size: 14px;
  }

  .legend-item {
    font-size: 13px;
    padding: 2px 4px;
  }

  .legend .legend-icon {
    width: clamp(22px, 3vh, 30px);
    height: clamp(22px, 3vh, 30px);
  }

  .legend .minimap-icon,
  .legend-icon .minimap-icon {
    --icon: clamp(16px, 2.2vh, 22px);
  }
}

@media (max-width: 1100px) {
  .game-wrap {
    grid-template-columns:
      minmax(240px, min(28vw, 320px))
      minmax(0, 1fr)
      minmax(220px, min(26vw, 300px));
    gap: 8px;
  }
  .menu-plaque {
    padding: 28px 18px 22px;
  }
  .quit-modal .modal-actions,
  .skip-modal .modal-actions {
    grid-template-columns: 1fr;
  }
}

.profile-screen {
  justify-content: center;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  padding: 10px 16px 12px;
  overflow: hidden;
}

.profile-plaque {
  width: min(1100px, 96vw);
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  align-items: stretch;
  padding: 38px 36px 28px;
  overflow: hidden;
  box-sizing: border-box;
}

.profile-screen:not(.friends-screen) .profile-plaque {
  height: 100%;
}

.profile-pane-home {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.profile-pane-home.is-cal-only {
  overflow: hidden;
}

.profile-pane-home.is-cal-only .profile-cal {
  height: 100%;
}

.profile-home-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

.profile-gos,
.profile-home-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.profile-gos {
  display: grid;
  grid-auto-rows: 1fr;
  height: 100%;
}

.profile-go,
.profile-cal,
.profile-stat,
.profile-mode,
.friend-compare,
.profile-custom-col {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(92, 58, 28, 0.5), transparent 58%),
    linear-gradient(180deg, #3d2a1c 0%, #261910 52%, #16100c 100%);
  border: 3px solid #d4b06a;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 170, 0.28),
    inset 0 0 0 4px #2a1c12,
    inset 0 0 0 6px #8a6230,
    6px 7px 0 #000;
}

.profile-go {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  appearance: none;
  font: inherit;
  text-align: center;
  color: #f3d78a;
  cursor: pointer;
}

.profile-go b {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 8px;
  box-sizing: border-box;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: none;
  color: #f3d78a;
  text-shadow: 2px 3px 0 #000, 0 0 14px rgba(232, 184, 72, 0.24);
  transform: translateY(-3px);
}

.profile-go:hover,
.profile-go:focus-visible {
  border-color: #f0d48a;
  outline: none;
}

.profile-go:hover b,
.profile-go:focus-visible b {
  color: #fff0b4;
}

.profile-home-links .profile-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  flex-shrink: 0;
}

.profile-home-links .profile-social .friend-btn {
  width: auto;
  min-height: 40px;
  flex: 1 1 140px;
  padding: 8px 12px;
}

.profile-home-links .profile-gos {
  flex: 1;
}

.profile-cal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: auto;
  max-width: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 34px 32px 26px;
}

.profile-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.profile-cal-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.profile-cal-title span {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a89870;
}

.profile-cal-head h2 {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f3d78a;
  text-shadow: 1px 2px 0 #000;
}

.profile-cal-nav {
  width: 40px;
  height: 38px;
  padding: 0;
  color: #f0d48a;
  background:
    linear-gradient(180deg, #2a1c12, #18110c);
  border: 2px solid #c4a06a;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.profile-cal-nav:hover,
.profile-cal-nav:focus-visible {
  border-color: #fff0b8;
  outline: none;
}

.profile-cal-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.profile-cal-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.85fr);
  gap: 14px;
  min-height: 0;
  align-items: stretch;
}

.profile-cal-month {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 14px 12px 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid #5a4028;
  box-shadow: inset 0 0 0 1px rgba(20, 10, 6, 0.3);
}

.profile-cal-week,
.profile-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.profile-cal-week span {
  text-align: center;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d4b878;
}

.profile-cal-grid {
  flex: 1;
  align-content: stretch;
  min-height: 0;
}

.profile-cal-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 38px;
  height: auto;
  padding: 0;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #5a4028;
  box-shadow: inset 0 0 0 1px rgba(20, 10, 6, 0.35);
}

.profile-cal-cell i {
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: transparent;
}

button.profile-cal-cell {
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

button.profile-cal-cell:hover,
button.profile-cal-cell:focus-visible {
  border-color: #e8c878;
  outline: none;
}

.profile-cal-cell.is-on {
  border-color: #fff0b8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 184, 0.45),
    0 0 10px rgba(212, 176, 80, 0.2);
}

.profile-cal-cell em {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  font-style: normal;
  color: #cbb48a;
}

.profile-cal-cell.is-pad {
  visibility: hidden;
}

.profile-cal-cell.is-future,
.profile-cal-cell.is-idle {
  opacity: 0.4;
}

.profile-cal-cell.is-play,
.profile-cal-cell.is-clear {
  background: rgba(40, 56, 28, 0.55);
  border-color: #6a8a48;
}

.profile-cal-cell.is-play em,
.profile-cal-cell.is-clear em {
  color: #d8e8b0;
}

.profile-cal-cell.is-play i,
.profile-cal-cell.is-clear i {
  background: #9ec86a;
}

.profile-cal-cell.is-skip {
  background: rgba(56, 24, 20, 0.45);
  border-color: #6a3a32;
}

.profile-cal-cell.is-skip em {
  color: #c89080;
}

.profile-cal-cell.is-skip i {
  background: #c07060;
}

.profile-cal-cell.is-today {
  border-color: #e8c878;
  box-shadow:
    inset 0 0 0 1px rgba(232, 200, 120, 0.35),
    0 0 10px rgba(212, 176, 80, 0.18);
}

.profile-cal-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 2px 0 0;
  flex-shrink: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a89880;
}

.profile-cal-legend .is-play { color: #b8d090; }
.profile-cal-legend .is-skip { color: #d09080; }
.profile-cal-legend .is-today { color: #e8c878; }

.profile-cal-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 18px 16px 16px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(232, 184, 72, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(36, 24, 16, 0.72), rgba(10, 8, 6, 0.55));
  border: 2px solid #8a6230;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.14),
    inset 0 0 0 1px rgba(20, 10, 6, 0.4),
    4px 4px 0 rgba(0, 0, 0, 0.45);
}

.profile-cal-card.is-empty {
  justify-content: center;
  text-align: center;
  color: #a89880;
}

.profile-cal-card.is-empty p {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 18px;
  color: #a89880;
}

.profile-cal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profile-cal-card-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-cal-card-kicker {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a89870;
}

.profile-cal-card-head b {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.1;
  color: #f3d78a;
  text-shadow: 1px 2px 0 #000;
}

.profile-cal-pill {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 6px 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d8c8a8;
  border: 1px solid #5a4028;
  background: rgba(0, 0, 0, 0.34);
  box-shadow: inset 0 0 0 1px rgba(20, 10, 6, 0.28);
}

.profile-cal-pill.is-play,
.profile-cal-pill.is-clear {
  color: #d8e8b0;
  border-color: #6a8a48;
  background: rgba(40, 56, 28, 0.45);
}

.profile-cal-pill.is-skip {
  color: #d09080;
  border-color: #6a3a32;
  background: rgba(56, 24, 20, 0.4);
}

.profile-cal-pill.is-today {
  color: #e8c878;
  border-color: #c4a06a;
  background: rgba(72, 48, 16, 0.35);
}

.profile-cal-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.profile-cal-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px 11px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 220, 140, 0.08), transparent 62%),
    rgba(0, 0, 0, 0.32);
  border: 1px solid #5a4028;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, 0.08),
    inset 0 0 0 1px rgba(20, 10, 6, 0.28);
}

.profile-cal-tile span {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a89870;
}

.profile-cal-tile b {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: #efe0c4;
  text-shadow: 1px 1px 0 #000;
  word-break: break-word;
}

.profile-cal-tile.is-mode b {
  font-size: clamp(20px, 2.4vw, 24px);
  color: #f3d78a;
}

.profile-cal-tile.is-goal b {
  color: #ffe7a0;
  font-size: 20px;
}

.profile-cal-tile.is-score {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(232, 184, 72, 0.18), transparent 60%),
    rgba(0, 0, 0, 0.36);
  border-color: #8a6230;
}

.profile-cal-tile.is-score b {
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: 0.02em;
  color: #f3d78a;
  text-shadow: 2px 3px 0 #000;
}

.profile-cal-tile.is-score i {
  font-style: normal;
  font-size: 0.52em;
  color: #cbb48a;
  text-shadow: 1px 2px 0 #000;
}

.profile-cal-tile.is-pct {
  border-color: #6a8a48;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(140, 180, 80, 0.14), transparent 60%),
    rgba(0, 0, 0, 0.32);
}

.profile-cal-tile.is-pct b {
  font-size: 16px;
  line-height: 1.35;
  color: #d8e8b0;
}

.profile-cal-tile.is-seed b {
  font-family: "Courier New", Courier, monospace;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: #ffe7a0;
}

.profile-cal-note {
  margin: 0;
  padding: 10px 12px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 14px;
  line-height: 1.35;
  color: #b8a888;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed #5a4028;
}

.profile-cal-card.is-skip .profile-cal-note {
  color: #d09080;
  border-color: #6a3a32;
}

.profile-cal-detail {
  display: none;
}

.badge-pick-dialog,
.achieve-dialog {
  width: min(720px, 100%);
  max-height: min(94vh, 980px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px 38px 32px;
}

.achieve-dialog .mode-help-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.achieve-dialog .history-pager,
.badge-pick-dialog .history-pager,
.achieve-dialog .mode-help-close,
.badge-pick-dialog .mode-help-close {
  flex-shrink: 0;
}

.badge-pick-hint {
  margin: -6px 0 12px;
  text-align: center;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 15px;
  color: #a89880;
}

.badge-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  overflow: hidden;
  min-height: 0;
  margin-bottom: 16px;
}

.badge-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  color: #d8c8a8;
  background: rgba(16, 10, 8, 0.7);
  border: 2px solid #6a4e2c;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.badge-pick span {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 14px;
  text-align: left;
}

.badge-pick .nick-badge,
.badge-pick-none {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.badge-pick-none {
  display: block;
  border: 2px dashed #6a4e2c;
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.badge-pick.is-on,
.badge-pick:hover,
.badge-pick:focus-visible {
  border-color: #e8c878;
  color: #fff0c8;
  outline: none;
}

.achieve-list {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 4px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  overflow: visible;
}

.achieve-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  background: rgba(16, 10, 8, 0.7);
  border: 2px solid #6a4e2c;
  box-shadow: 3px 3px 0 #000;
}

.achieve-row .nick-badge {
  width: 32px;
  height: 32px;
}

.achieve-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.achieve-copy b {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  color: #fff0c8;
}

.achieve-copy small {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 13px;
  color: #c8b090;
}

.achieve-copy em {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b8d090;
}

.achieve-row.is-off {
  opacity: 0.55;
}

.achieve-row.is-off .nick-badge {
  filter: grayscale(1) brightness(0.7);
}

.achieve-row.is-off .achieve-copy em {
  color: #a87868;
}

.achieve-row.is-on {
  border-color: #a88848;
}

.nick-badge {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.menu-who,
.profile-id .profile-nick,
.board-nick,
.friend-who-text b {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.board-nick,
.friend-who-text b {
  justify-content: flex-start;
}

.menu-who .nick-badge {
  width: 28px;
  height: 28px;
}

.profile-id .profile-nick .nick-badge {
  width: 36px;
  height: 36px;
}

.profile-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-tools .sfx-control {
  height: 36px;
}

.privacy-gear {
  width: 36px;
  height: 36px;
}

.privacy-gear {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  color: #f0d48a;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 230, 180, 0.16), transparent 62%),
    linear-gradient(180deg, #3a2a20, #18110d);
  border: 2px solid #c4a06a;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.28),
    inset 0 0 0 1px #2a1c14,
    3px 3px 0 #000;
  cursor: pointer;
}

.privacy-gear svg {
  display: block;
  width: 18px;
  height: 18px;
}

.privacy-gear:hover,
.privacy-gear:focus-visible {
  color: #fff6e0;
  border-color: #fff0b8;
  outline: none;
}

.auth-notice {
  min-height: 1.2em;
  margin: 0;
  text-align: center;
  color: #c8e0a8;
  font-size: 16px;
}

.privacy-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 0 16px;
}

.privacy-security {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.privacy-security h3 {
  margin: 10px 0 2px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e8c878;
  text-shadow: 1px 1px 0 #000;
}

.privacy-security h3:first-child {
  margin-top: 0;
}

.privacy-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
  position: relative;
}

.privacy-form input,
.privacy-form select {
  width: 100%;
  padding: 10px 12px;
  color: #fff4d4;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  background: #16100c;
  border: 2px solid #8a6a3c;
  box-shadow: inset 2px 2px 0 #000;
}

.privacy-form input:focus,
.privacy-form select:focus {
  outline: none;
  border-color: var(--gold);
}

.privacy-form input:-webkit-autofill,
.privacy-form input:-webkit-autofill:hover,
.privacy-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff4d4;
  caret-color: #fff4d4;
  box-shadow: inset 0 0 0 1000px #16100c;
  transition: background-color 99999s ease-out;
}

.privacy-dialog {
  width: min(560px, 100%);
  padding: 40px 38px 32px;
}

.secret-seed-dialog {
  width: min(480px, 100%);
  padding: 40px 38px 32px;
}

.secret-seed-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.secret-seed-form input {
  width: 100%;
  padding: 12px 14px;
  color: #fff4d4;
  font-family: "Courier New", Courier, monospace;
  font-size: 20px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  background: #16100c;
  border: 2px solid #8a6a3c;
  box-shadow: inset 2px 2px 0 #000;
}

.secret-seed-form input:focus {
  outline: none;
  border-color: var(--gold);
}

.secret-seed-error {
  min-height: 1.2em;
  text-align: center;
  color: #e8a090;
  font-size: 15px;
}

.profile-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  margin-bottom: 0;
  padding: 0;
  background-image: none;
  border: 0;
  box-shadow: none;
}

.profile-head-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
  flex: 1;
}

.profile-screen.tab-stats .profile-foot {
  margin-top: 10px;
}

.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 12px;
  margin: 14px 0 12px;
  padding: 0 0 10px;
  background-image: linear-gradient(90deg, transparent, #8a6230 8%, #e0c070 50%, #8a6230 92%, transparent);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: bottom;
}

.profile-tab {
  position: relative;
  flex: none;
  flex-shrink: 0;
  min-width: 0;
  padding: 0 2px 8px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #a89880;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  box-shadow: none;
  cursor: pointer;
}

.profile-tab.is-on,
.profile-tab:hover,
.profile-tab:focus-visible {
  color: #f3d78a;
  background: none;
  border-color: #e8c878;
  outline: none;
}

.profile-pane {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.profile-pane-stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.profile-pane-custom {
  display: flex;
  overflow: hidden;
}

.profile-pane-friends,
.profile-pane-history,
.profile-pane-achieve {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.profile-pane-friends .friends-tabs,
.profile-pane-history .history-tabs {
  flex-shrink: 0;
  margin: 0;
}

.profile-pane-friends .profile-find {
  flex-shrink: 0;
  margin: 0;
}

.profile-pane-friends .friend-list,
.profile-pane-history .profile-history,
.profile-pane-achieve .achieve-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

.profile-pane-achieve .achieve-list {
  gap: 6px;
}

.profile-pane-achieve .achieve-row {
  flex: 1 1 0;
  min-height: 0;
  padding: 8px 12px;
  box-sizing: border-box;
}

.profile-pane-achieve .achieve-row .nick-badge {
  width: 36px;
  height: 36px;
}

.profile-pane-friends .friends-pager,
.profile-pane-history .history-pager,
.profile-pane-achieve .history-pager {
  flex-shrink: 0;
  margin: 0;
}

.profile-tab .profile-badge {
  top: -10px;
  right: -12px;
  font-size: 11px;
}

.profile-custom-gos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.profile-custom-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 26px 22px 16px;
  overflow: hidden;
}

.profile-custom-col h2 {
  flex-shrink: 0;
  margin: 0 0 8px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.15;
  text-align: center;
  color: #f3d78a;
  text-shadow: 2px 3px 0 #000, 0 0 14px rgba(232, 184, 72, 0.24);
}

.profile-custom-col .avatar-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  place-items: center;
  gap: 5px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.profile-custom-col .avatar-pick {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 2px;
  border-width: 1px;
  box-shadow: inset 0 0 0 1px #2a1c14;
}

.profile-custom-col .avatar-pick:not(.is-framed):not(.badge-tile) img {
  width: 78%;
  height: 78%;
}

.profile-custom-col .badge-tile .nick-badge,
.profile-custom-col .badge-tile .badge-pick-none {
  width: 68%;
  height: 68%;
}

.profile-custom-col .history-pager {
  flex-shrink: 0;
  min-height: 28px;
  margin: 8px 0 0;
}

.profile-head .menu-portrait {
  width: 148px;
  height: 148px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.profile-portrait.is-static,
.profile-portrait {
  position: relative;
  padding: 0;
  font: inherit;
  color: inherit;
}

.profile-portrait.is-static {
  cursor: default;
}

button.profile-portrait {
  cursor: pointer;
}

button.profile-portrait:hover,
button.profile-portrait:focus-visible {
  border-color: #f0d48a;
  outline: none;
}

button.profile-portrait.is-framed:hover,
button.profile-portrait.is-framed:focus-visible {
  border: none;
  filter: brightness(1.08);
}

.profile-id-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}

.profile-customize {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  padding: 6px 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f0d48a;
  background: #18110c;
  border: 2px solid #c4a06a;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.profile-chip:hover,
.profile-chip:focus-visible {
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border-color: #f8e4a0;
  outline: none;
}

.privacy-account {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 8px;
  padding-top: 16px;
  background-image: linear-gradient(90deg, transparent, #8a6230 12%, #e0c070 50%, #8a6230 88%, transparent);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: top;
}

.privacy-account h3 {
  margin: 0 0 4px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e8c878;
  text-shadow: 1px 1px 0 #000;
}

.privacy-exit {
  width: 100%;
  padding: 10px 14px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  color: #e8d0a8;
  background: #18110c;
  border: 2px solid #8a6a3c;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.privacy-exit:hover,
.privacy-exit:focus-visible {
  color: #fff0b4;
  border-color: #e8c878;
  outline: none;
}

.privacy-exit.is-danger {
  color: #d8a090;
  border-color: #8a4a40;
}

.privacy-exit.is-danger:hover,
.privacy-exit.is-danger:focus-visible {
  color: #f0c0b0;
  border-color: #e07070;
}

.avatar-dialog {
  width: min(600px, 100%);
  height: min(580px, 88vh);
  max-height: min(580px, 88vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 36px 34px 28px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.avatar-dialog .mode-help-head {
  margin: 0 0 10px;
  padding-bottom: 12px;
  flex-shrink: 0;
}

.avatar-dialog .board-tabs {
  margin: 0 0 10px;
  flex-shrink: 0;
}

.avatar-dialog .avatar-grid {
  flex: 1 1 auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  min-height: 0;
  overflow: hidden;
}

.avatar-dialog .history-pager {
  flex-shrink: 0;
  min-height: 32px;
  margin: 10px 0 8px;
}

.avatar-dialog .mode-help-close {
  flex-shrink: 0;
}

@media (max-height: 760px) {
  .profile-head .menu-portrait {
    width: 120px;
    height: 120px;
  }

  .profile-id .profile-nick {
    font-size: clamp(26px, 3.2vw, 34px);
  }

  .profile-custom-col {
    padding: 26px 22px 16px;
  }

  .profile-custom-col h2 {
    margin-bottom: 6px;
    font-size: 18px;
  }

}

@media (max-height: 620px) {
  .avatar-dialog {
    height: min(500px, 92vh);
    max-height: min(500px, 92vh);
  }

  .avatar-dialog .mode-help-head {
    margin-bottom: 6px;
    padding-bottom: 8px;
  }
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.frame-pick {
  position: relative;
  overflow: hidden;
}

.avatar-dialog .avatar-pick {
  aspect-ratio: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.avatar-pick {
  aspect-ratio: 1;
  padding: 4px;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 230, 180, 0.12), transparent 62%),
    #140e0a;
  border: 3px solid #6a4e2c;
  box-shadow: inset 0 0 0 2px #2a1c14, 4px 4px 0 #000;
  cursor: pointer;
}

.avatar-pick img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: pixelated;
  background: transparent;
}

.avatar-pick.is-on,
.avatar-pick:hover,
.avatar-pick:focus-visible {
  border-color: #e8c878;
  outline: none;
}

.avatar-pick.is-on {
  box-shadow:
    inset 0 0 0 2px #2a1c14,
    4px 4px 0 #000,
    0 0 16px rgba(232, 176, 64, 0.35);
}

.profile-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 1.4em;
  padding: 2px 6px;
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0;
  color: #fff4d4;
  background: #8a2820;
  border: 2px solid #f0d48a;
  box-shadow: 2px 2px 0 #000;
}

.board-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
}

.friends-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.friends-head .profile-nick {
  margin: 0;
  font-family: "Pixelify Sans", "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #ffe7a0;
  text-shadow:
    2px 0 0 #140a06,
    -2px 0 0 #140a06,
    0 2px 0 #140a06,
    0 -2px 0 #140a06,
    3px 4px 0 #4a140c;
}

.friends-tabs {
  flex-wrap: wrap;
  margin: 8px 0 18px;
}

.friends-tab-count {
  font-style: normal;
  margin-left: 4px;
}

.board-tab {
  padding: 7px 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d8c8a8;
  background: #16100c;
  border: 2px solid #6a4e2c;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.board-tab.is-on,
.board-tab:hover,
.board-tab:focus-visible {
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border-color: #f8e4a0;
  outline: none;
}

.board tr.is-friend td {
  background: rgba(80, 140, 80, 0.1);
}

.board i.is-friend,
.board td.is-up {
  color: #b8e0a0;
}

.board td.is-down {
  color: #e8a090;
}

.profile-social {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
}

.profile-actions .profile-social {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.profile-actions .profile-social .friend-status {
  grid-column: auto;
  min-height: 44px;
  height: 44px;
  padding: 0 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-actions .profile-social .friend-btn,
.profile-actions .profile-social .friend-btn.is-done {
  width: 100%;
  min-height: 44px;
  height: 44px;
  padding: 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.profile-actions .profile-social .friend-btn.is-done {
  opacity: 0.75;
  cursor: default;
}

.profile-social .friend-status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  color: #f0d8a0;
  background: rgba(20, 14, 10, 0.55);
  border: 2px solid #8a6a3c;
  box-shadow: inset 0 0 0 1px #2a1c14, 3px 3px 0 #000;
}

.profile-social .friend-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.profile-social .friend-btn:hover,
.profile-social .friend-btn:focus-visible {
  transform: translate(-2px, -2px);
  outline: none;
}

.profile-social .friend-btn.is-ghost:hover,
.profile-social .friend-btn.is-ghost:focus-visible {
  color: #fff4d4;
  border-color: #e8c878;
}

.profile-social .friend-btn:active {
  transform: translate(2px, 2px);
}

.friend-status {
  color: #cbb48a;
  font-size: 14px;
}

.friend-btn {
  padding: 8px 12px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border: 2px solid #f8e4a0;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.friend-btn.is-ghost {
  color: #f0d8a0;
  background: #16100c;
  border-color: #6a4e2c;
}

.friend-btn.is-danger {
  color: #fff0e8;
  background: linear-gradient(180deg, #c06048, #8a2820);
  border-color: #e8a090;
}

.friend-btn.is-danger:hover,
.friend-btn.is-danger:focus-visible {
  border-color: #ffd0c0;
  outline: none;
}

.friend-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.friend-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: visible;
}

.friends-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: #cbb48a;
}

.friends-pager-btn {
  width: 36px;
  height: 32px;
  padding: 0;
  color: #f0d48a;
  background: #18110c;
  border: 2px solid #c4a06a;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.friends-pager-btn:hover,
.friends-pager-btn:focus-visible {
  border-color: #fff0b8;
  outline: none;
}

.friends-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 230, 180, 0.1), transparent 46%),
    #18110c;
  border: 3px solid #c4a06a;
  box-shadow:
    inset 0 0 0 2px #2a1c14,
    4px 5px 0 #000;
}

.friend-who {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0;
  font: inherit;
  color: #ffe7a0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.friend-who:hover b,
.friend-who:focus-visible b {
  color: #fff8dc;
}

.friend-who-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.friend-who-text b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Pixelify Sans", "Press Start 2P", "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.friend-who-text small {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 14px;
  color: #cbb48a;
}

.friend-face {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: #140e0a;
  border: 3px solid #e8c878;
  box-shadow: inset 0 0 0 2px #2a1c14, 3px 3px 0 #000;
}

.friend-face.is-framed {
  border: none;
  box-shadow: none;
}

.friend-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.friend-face.is-framed img {
  width: 62%;
  height: 62%;
}

.friend-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 900px) {
  .profile-head-main {
    flex-wrap: wrap;
  }

  .profile-tools {
    margin-left: auto;
  }

  .profile-head .menu-portrait {
    width: 120px;
    height: 120px;
  }

  .profile-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-foot {
    flex-direction: column;
  }

  .profile-nav {
    flex-basis: auto;
  }
}

@media (max-width: 720px) {
  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .profile-home-body {
    grid-template-columns: 1fr;
  }

  .profile-gos {
    height: auto;
  }

  .profile-go {
    min-height: 96px;
  }

  .profile-cal {
    height: auto;
    min-height: 340px;
  }

  .profile-cal-body {
    grid-template-columns: 1fr;
  }

  .daily-you {
    grid-template-columns: 1fr;
  }

  .daily-you-side {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(212, 176, 106, 0.28);
    padding-top: 10px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-tabs {
    gap: 8px;
    flex-wrap: wrap;
  }

  .profile-tab {
    min-width: 0;
    font-size: 15px;
  }

  .profile-custom-gos {
    gap: 10px;
  }

  .friend-row {
    flex-direction: column;
    align-items: stretch;
  }

  .friend-row-actions {
    justify-content: flex-start;
  }
}

.friend-compare {
  flex-shrink: 0;
  margin: 4px 0 0;
  padding: 22px 20px 16px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.friend-compare-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
  text-align: center;
}

.friend-compare-kicker {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #d4b878;
}

.friend-compare-date {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: #fff3c4;
  text-shadow: 1px 2px 0 #000;
}

.friend-compare-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  border: 1px solid #6a4e2c;
  box-shadow: inset 0 0 0 1px rgba(212, 176, 90, 0.08);
}

.friend-compare-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 8px;
  min-width: 0;
  text-align: center;
}

.friend-compare-side.is-you {
  background: linear-gradient(180deg, rgba(80, 52, 20, 0.35), rgba(20, 14, 8, 0.2));
  border-right: 1px solid #8a6a3c;
  box-shadow: 1px 0 0 rgba(255, 220, 150, 0.1);
}

.friend-compare-side.is-them {
  background: linear-gradient(180deg, rgba(40, 24, 16, 0.2), rgba(12, 8, 6, 0.28));
}

.friend-compare-who {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4b878;
}

.friend-compare-score {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 26px;
  line-height: 1;
  color: #fff6d0;
  text-shadow: 1px 2px 0 #000;
}

.friend-compare table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.friend-compare th,
.friend-compare td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-compare th:first-child,
.friend-compare td:first-child {
  width: 40%;
}

.friend-compare th:nth-child(2),
.friend-compare td:nth-child(2),
.friend-compare th:nth-child(3),
.friend-compare td:nth-child(3) {
  width: 30%;
}

.friend-compare th {
  color: var(--gold);
  font-size: 14px;
}

.friend-compare td.is-up {
  color: #b8e0a0;
}

.friend-compare td.is-down {
  color: #e8a090;
}

.profile-id {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.profile-id .profile-nick {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  max-width: 100%;
  margin: 0 0 6px;
  padding: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.15;
  text-transform: none;
  color: #f3d78a;
  background: none;
  border: none;
  box-shadow: none;
  text-shadow: 2px 3px 0 #000, 0 0 18px rgba(232, 184, 72, 0.28);
}

.profile-id p,
.profile-since {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  color: #b8a080;
}

.profile-status {
  margin: 8px 0 12px;
  text-align: center;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  color: #d8c8a8;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding-bottom: 16px;
  flex-shrink: 0;
  border-bottom: 2px solid #c4a060;
  box-shadow: 0 1px 0 rgba(243, 215, 138, 0.28);
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 0;
  padding: 18px 16px 14px;
  text-align: center;
}

.profile-stat-label {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4b878;
}

.profile-stat-value {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 22px;
  line-height: 1;
  color: #fff3c4;
  text-shadow: 2px 2px 0 #000;
}

.profile-stat-note {
  font-size: 12px;
  color: #a89880;
}

.profile-section {
  margin: 2px 0 4px;
  padding-bottom: 3px;
  flex-shrink: 0;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-align: center;
  color: #f3d78a;
  border-bottom: 1px solid #6a4e2c;
  box-shadow: 0 1px 0 rgba(255, 220, 150, 0.08);
}

.profile-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
}

.profile-mode {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-height: 0;
  height: 100%;
  padding: 22px 20px 16px;
  text-align: center;
}

.profile-mode-head h3 {
  margin: 0 0 1px;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #fff0c8;
  text-shadow: 1px 2px 0 #000;
}

.profile-mode-runs {
  margin: 0;
  font-size: 14px;
  color: #c4b08a;
}

.profile-best {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.profile-best-label {
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d4b878;
}

.profile-best-lines {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 2px 2px;
  gap: 1px;
  border-width: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 232, 180, 0.08);
}

.profile-best-lines .congrats-line {
  min-height: 22px;
  padding: 1px 2px;
  gap: 6px;
}

.profile-best-lines .legend-icon {
  width: 24px;
  height: 24px;
}

.profile-best-lines .legend-icon .minimap-icon {
  --icon: 16px;
}

.profile-best-lines .congrats-line-label {
  font-size: 13px;
}

.profile-best-lines .congrats-line-count {
  font-size: 16px;
}

.profile-best-empty {
  flex: 1;
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 0;
  padding: 6px;
  color: #8a7a62;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed #6a4e2c;
}

.profile-mode-inner {
  display: block;
  margin-bottom: 2px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cbb48a;
}

.profile-mode-best-label {
  margin-top: 2px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbb48a;
}

.profile-mode-best {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 18px;
  color: #f3d78a;
  text-shadow: 0 2px 0 #000;
}

.profile-mode-seed {
  display: block;
  margin-top: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8a7a62;
}

.profile-history {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #6a4e2c;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(212, 176, 90, 0.08), 4px 4px 0 #000;
}

.profile-privacy {
  display: grid;
  gap: 6px;
  margin: 0 0 8px;
}

.privacy-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  text-align: left;
  color: #d8c8a8;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid #6a4e2c;
  box-shadow: inset 0 0 0 1px rgba(212, 176, 90, 0.08), 3px 3px 0 #000;
  cursor: pointer;
}

.privacy-opt:hover,
.privacy-opt:focus-visible {
  border-color: #e0c070;
  outline: none;
}

.privacy-opt.is-on {
  color: #fff0b4;
  border-color: #c4a06a;
}

.privacy-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  padding: 2px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0;
  line-height: 0;
  background: #2a1c14;
  border: 0;
  box-shadow: none;
  box-sizing: border-box;
  overflow: hidden;
}

.privacy-switch::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8a7a62;
  box-shadow: none;
  transform: none;
}

.privacy-opt.is-on .privacy-switch {
  justify-content: flex-end;
  background: #6a4a18;
}

.privacy-opt.is-on .privacy-switch::after {
  background: #f0d48a;
}

.privacy-opt-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.privacy-opt-text b {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 15px;
  font-weight: 700;
}

.privacy-opt-text small {
  font-size: 11px;
  color: #a89880;
}

.profile-foot {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
}

.profile-extra-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.profile-extra-actions .history-btn {
  margin-top: 0;
}

.profile-extra-actions .history-btn,
.profile-screen .history-btn {
  padding: 16px 20px;
  font-size: clamp(16px, 2vw, 20px);
  letter-spacing: 0.14em;
  border-width: 3px;
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 220, 0.55),
    inset 0 -3px 0 rgba(80, 48, 8, 0.35),
    8px 8px 0 #000,
    0 0 20px rgba(212, 176, 80, 0.22);
}

.history-btn {
  position: relative;
  width: 100%;
  margin-top: 4px;
  padding: 16px 20px;
  font-family: "Courier New", Courier, monospace;
  font-size: clamp(16px, 2.2vw, 20px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a 0%, #c09038 55%, #8a6420 100%);
  border: 3px solid #f8e4a0;
  box-shadow:
    inset 0 2px 0 rgba(255, 248, 220, 0.55),
    inset 0 -3px 0 rgba(80, 48, 8, 0.35),
    8px 8px 0 #000,
    0 0 20px rgba(212, 176, 80, 0.22);
  text-shadow: 0 1px 0 rgba(255, 248, 220, 0.45);
  cursor: pointer;
}

.history-btn:hover,
.history-btn:focus-visible {
  border-color: #fff8d8;
  color: #140c06;
  outline: none;
}

.history-btn:active {
  box-shadow:
    inset 0 2px 0 rgba(80, 48, 8, 0.35),
    4px 4px 0 #000;
}

.history-dialog {
  width: min(860px, 100%);
  max-height: none;
  overflow: hidden;
  padding: 42px 40px 34px;
}

.history-tabs {
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.history-dialog .board-tab {
  padding: 6px 10px;
  font-size: 11px;
}

.history-dialog .profile-history {
  max-height: none;
  overflow: hidden;
}

.history-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 16px;
}

.history-page {
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: #f0d48a;
  background: #18110c;
  border: 2px solid #c4a06a;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
}

.history-page-gap {
  min-width: 20px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8a7a62;
  font-family: "Courier New", Courier, monospace;
}

.history-page:hover,
.history-page:focus-visible,
.history-page.is-on {
  color: #1a1208;
  background: linear-gradient(180deg, #f0d48a, #c09038);
  border-color: #f8e4a0;
  outline: none;
}

.profile-history table {
  width: 100%;
  border-collapse: collapse;
}

.profile-history th,
.profile-history td {
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #3d2f26;
}

.profile-history th {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cbb48a;
  background: rgba(40, 28, 18, 0.85);
}

.profile-history tr:last-child td {
  border-bottom: 0;
}

.profile-hist-score {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
  color: #f3d78a;
}

.profile-hist-empty {
  text-align: center;
  color: #a89880;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 16px;
}

.profile-tag {
  display: inline-block;
  padding: 2px 7px 1px;
  font-family: "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-tag.is-clear {
  color: #1a2014;
  background: #7cb86a;
}

.profile-tag.is-quit {
  color: #f0d8d4;
  background: #7a3028;
}

.profile-find {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
}

.profile-find input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  color: #fff4d4;
  font-size: 16px;
  background: #16100c;
  border: 2px solid #8a6a3c;
  box-shadow: inset 2px 2px 0 #000;
}

.profile-find input:focus {
  outline: none;
  border-color: var(--gold);
}

.profile-find-btn {
  width: auto;
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px;
  font-size: 16px;
}

.profile-nav {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  gap: 10px;
  margin-top: 0;
  flex: 1;
  width: 100%;
}

.profile-screen:not(.is-other):not(.friends-screen) .profile-nav {
  flex: none;
  align-self: flex-start;
  width: auto;
}

.profile-back {
  width: auto;
  flex: 1;
  min-width: 0;
  padding: 8px 16px;
  font-size: 16px;
}

.profile-screen:not(.is-other):not(.friends-screen) .profile-back {
  flex: none;
  min-width: 140px;
}

.profile-screen.is-other .profile-nav {
  flex: none;
  align-self: center;
  width: min(520px, 100%);
}

.profile-screen.is-other .profile-back {
  min-height: 52px;
  padding: 14px 20px;
  font-size: 20px;
}

.friends-screen {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  justify-content: center;
  padding-top: 12px;
}

.friends-screen .profile-plaque {
  width: min(720px, 96vw);
  padding: 38px 36px 28px;
}

.friends-screen .profile-top,
.friends-screen .friends-head {
  padding-right: 0;
}

.friends-foot,
.friends-screen .profile-nav {
  flex: none;
  align-self: center;
  width: min(280px, 100%);
  margin: 10px auto 0;
}

.friends-screen .profile-back {
  flex: none;
  width: 100%;
  min-height: 44px;
  padding: 12px 18px;
  font-size: 18px;
}

.profile-screen .auth-error {
  text-align: center;
  margin: 8px 0 16px;
}

.admin-plaque {
  width: min(1100px, 96vw);
  padding: 38px 36px 28px;
  overflow: hidden;
}

.admin-pane {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-card {
  padding: 12px 14px;
  background: rgba(16, 10, 8, 0.7);
  border: 2px solid #6a4e2c;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-card b {
  font-size: 22px;
  color: #f3d78a;
}

.admin-card span,
.admin-split p,
.admin-log,
.admin-player p {
  color: #c8b090;
  font-size: 14px;
}

.admin-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-actions,
.admin-row,
.admin-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-actions button,
.admin-row button,
.admin-search button,
.admin-dl,
.admin-log button {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  padding: 8px 12px;
  color: #fff0c8;
  background: #3a2818;
  border: 2px solid #8a6230;
  cursor: pointer;
}

.admin-dl {
  text-decoration: none;
}

.admin-row input,
.admin-search input,
.admin-row select {
  padding: 8px 10px;
  background: #201410;
  color: #fff0c8;
  border: 2px solid #6a4e2c;
}

.admin-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.admin-log li,
.admin-table td,
.admin-table th {
  font-size: 13px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table-wrap {
  overflow: hidden;
}

.admin-head-tools {
  margin-left: auto;
}

@media (max-width: 900px) {
  .admin-grid,
  .admin-split {
    grid-template-columns: 1fr 1fr;
  }
}
