:root {
  color-scheme: light;
  --bg: #fbf7ef;
  --text: #283c35;
  --muted: #76847b;
  --mint: #8ddbc0;
  --green: #27795d;
  --red: #d7665b;
  --cream: #fffdf6;
  --gate-duration: 320ms;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background:
    radial-gradient(ellipse at 18% 18%, #dff2de88, transparent 42%),
    radial-gradient(ellipse at 90% 50%, #ffe0be66, transparent 40%), var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    "Noto Sans KR",
    sans-serif;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: 60px 0 0;
  background-image:
    linear-gradient(#53826c08 1px, transparent 1px),
    linear-gradient(90deg, #53826c08 1px, transparent 1px);
  background-size: 25px 25px;
  mask-image: linear-gradient(#000, transparent);
  -webkit-mask-image: linear-gradient(#000, transparent);
  pointer-events: none;
  z-index: -1;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.site-header {
  background: #111114;
  border-bottom: 1px solid #29292e;
  color: #f5f4f7;
}
.nav {
  max-width: 1000px;
  margin: auto;
  padding: 17px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.logo {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.7px;
}
.nav-links {
  display: flex;
  gap: 22px;
  font-size: 13px;
  color: #c9c7d0;
  flex-wrap: wrap;
}
.site-header .nav-links a.current {
  color: var(--mint);
}
.page {
  max-width: 1040px;
  margin: auto;
  padding: 24px 24px 40px;
}
.game-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.back {
  font-size: 12px;
  color: #65786c;
}
.brand-chip {
  font-size: 10px;
  letter-spacing: 1.4px;
  font-weight: 850;
  color: #729b87;
}
.eyebrow {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 2px;
  color: var(--green);
}
.welcome {
  max-width: 560px;
  margin: 35px auto 36px;
  text-align: center;
  position: relative;
  padding: 15px 24px 36px;
}
.hero-symbol {
  position: relative;
  width: 190px;
  margin: 0 auto 23px;
}
.hero-symbol img {
  width: 156px;
  height: 156px;
  filter: drop-shadow(0 16px 16px #6a96742b);
  transform: rotate(-9deg);
}
.symbol-spark {
  position: absolute;
  color: #dfa353;
  font-size: 28px;
}
.spark-a {
  left: -5px;
  top: 12px;
}
.spark-b {
  right: -2px;
  bottom: 20px;
  font-size: 39px;
  color: #62b89c;
}
.welcome h1 {
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -2px;
  margin: 12px 0;
}
.tagline {
  font-size: 16px;
  color: #6e8074;
  margin: 0;
  letter-spacing: -0.3px;
}
#nickname-form {
  max-width: 340px;
  margin: 30px auto 0;
}
#nickname {
  width: 100%;
  background: #fffefa;
  border: 2px solid #d3ded0;
  border-radius: 16px;
  padding: 17px 18px;
  text-align: center;
  font-size: 18px;
  color: #325846;
  box-shadow: 0 4px 0 #e3e5d9;
}
#nickname::placeholder {
  color: #8f9e91;
  font-size: 15px;
}
.small {
  font-size: 11px;
  line-height: 1.8;
  color: #7a887c;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.error {
  color: #b74539;
  font-size: 12px;
  min-height: 18px;
  margin: 6px 0 12px;
}
.primary,
.secondary,
.duel-button {
  border-radius: 15px;
  border: 2px solid #358563;
  min-height: 49px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 800;
  transition:
    filter 0.15s,
    transform 0.15s;
  box-shadow: 0 4px 0 #337e60;
}
.primary {
  background: #a7e5bf;
  color: #235641;
}
.secondary {
  background: #fff9eb;
  border-color: #d7cba8;
  color: #736748;
  box-shadow: 0 4px 0 #c5b88e;
}
.primary:hover,
.secondary:hover,
.duel-button:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}
.primary:active,
.secondary:active,
.duel-button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #337e60;
}
.start-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  width: 100%;
  font-size: 16px;
  min-height: 57px;
}
.welcome-features {
  margin-top: 29px;
  color: #7c927f;
  font-size: 12px;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.welcome-features i {
  font-style: normal;
  color: #c0cbbd;
}
.toolbar {
  max-width: 850px;
  margin: 26px auto 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.play-title {
  font-size: 25px;
  letter-spacing: -1.2px;
  margin: 5px 0;
}
.toolbar p {
  font-size: 12px;
  color: #7b897e;
  margin: 6px 0 0;
}
.title-die {
  font-size: 42px;
  color: #d5b066;
  transform: rotate(12deg);
}
.notice {
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  color: #a16344;
  min-height: 18px;
  margin: 0 auto 12px;
  max-width: 760px;
}
.notice:empty {
  visibility: hidden;
}
.arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 22px;
  position: relative;
  max-width: 850px;
  margin: auto;
  padding: 27px 31px 31px;
  border: 2px solid #d5dcca;
  border-radius: 30px;
  background: linear-gradient(125deg, #f4f4d8, #f5ead9);
  box-shadow:
    0 7px 0 #d8d7bb,
    0 20px 40px #5c6d3910;
  isolation: isolate;
}
.arena::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed #c6cdb488;
  border-radius: 23px;
  pointer-events: none;
  z-index: -1;
}
.arena.solo {
  display: block;
  max-width: 410px;
  padding: 24px 28px 27px;
  background: linear-gradient(130deg, #edf4dd, #e9eacd);
}
.board-panel {
  min-width: 0;
  position: relative;
}
.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 52px;
  margin-bottom: 16px;
}
.player-name {
  display: flex;
  align-items: center;
  gap: 9px;
}
.player-name > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.player-name strong {
  font-size: 11px;
  color: #7f917d;
}
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: #b9e2bc;
  color: #2d644a;
  border: 2px solid #86ba92;
  font-weight: 850;
  font-size: 22px;
  box-shadow: 0 3px 0 #83b58b;
}
.avatar.peer {
  background: #f7c1b6;
  border-color: #d59286;
  color: #af493f;
  box-shadow: 0 3px 0 #ce9281;
}
.progress {
  font-size: 17px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: #438264;
}
.opponent .progress,
.opponent-mark {
  color: #bf5a4e;
}
.opponent-mark {
  font-size: 27px;
}
.clock {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.clock span {
  font-size: 10px;
  color: #88977a;
}
.clock time {
  font-size: 21px;
  font-weight: 850;
  color: #526e45;
  font-variant-numeric: tabular-nums;
}
.versus {
  align-self: center;
  text-align: center;
  font-weight: 950;
  font-size: 22px;
  transform: rotate(-8deg);
  color: #bda66b;
  letter-spacing: -1px;
}
.solo .versus {
  display: none;
}
.board-shell {
  position: relative;
  isolation: isolate;
  border-radius: 20px;
  padding: 12px;
  background: #8ba98c;
  box-shadow:
    0 6px 0 #6e8c70,
    inset 0 1px 0 #bdd1a6;
  overflow: hidden;
}
.opponent .board-shell {
  background: #d4a08c;
  box-shadow:
    0 6px 0 #b17f70,
    inset 0 1px 0 #efc2a8;
}
.dice-board {
  position: relative;
  aspect-ratio: 1;
  perspective: 800px;
  border-radius: 12px;
  background: #6f8c70;
  touch-action: manipulation;
  box-shadow: inset 0 2px 8px #354f3944;
}
.readonly {
  background: #b48472;
}
.die {
  position: absolute;
  top: 0;
  left: 0;
  width: calc((100% - 20px) / 3);
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 14px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transform-style: preserve-3d;
}
.die-inner {
  position: absolute;
  inset: 0;
  border: 1px solid #e2dfc9;
  border-radius: 14px;
  background: linear-gradient(145deg, #fffef2, #ece7d2);
  box-shadow:
    0 4px 0 #b8b59b,
    0 7px 10px #23413230;
  transform-style: preserve-3d;
}
.die:not(:disabled):hover .die-inner {
  background: linear-gradient(145deg, #fff, #f0f6d9);
}
.die.correct .die-inner {
  border: 2px solid #91c398;
  box-shadow:
    0 4px 0 #a5ba8e,
    0 0 9px #c4ff943b,
    0 7px 10px #23413225;
}
.opponent .die.correct .die-inner {
  border-color: #deb0a0;
  box-shadow:
    0 4px 0 #c3a28d,
    0 0 9px #ffd3bd55;
}
.die .pip {
  position: absolute;
  width: 13%;
  height: 13%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #355647;
  box-shadow: inset 0 1px 2px #1f3a2e80;
}
.readonly .pip {
  background: #945346;
}
.gate {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: #c6d6aaeb;
  backdrop-filter: blur(3px);
  border: 3px solid #779171;
  border-radius: 18px;
  transform: translateY(-104%);
  transition: transform var(--gate-duration) cubic-bezier(0.3, 0.8, 0.3, 1);
  pointer-events: none;
}
.gate.closed {
  transform: translateY(0);
}
.gate.no-motion {
  transition: none;
}
.gate-grille {
  flex: 1;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(20% - 8px),
      #879f75 calc(20% - 8px) 20%
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 calc(33.33% - 5px),
      #adc099 calc(33.33% - 5px) 33.33%
    );
  box-shadow: inset 0 6px 0 #e0eac780;
}
.gate-rail {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #88a575;
  color: #f7ffe9;
  padding: 12px 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  border-top: 2px solid #769268;
}
.opponent .gate {
  background: #e9c3aee8;
  border-color: #b68371;
}
.opponent .gate-grille {
  filter: sepia(0.5);
}
.opponent .gate-rail {
  background: #bf8d76;
  color: #fff4e8;
}
.match-area {
  margin-top: 21px;
  min-height: 66px;
}
.duel-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 61px;
  background: #ffe5a1;
  border-color: #c3a24e;
  color: #785d23;
  box-shadow: 0 4px 0 #b29542;
  font-size: 14px;
}
.queue {
  height: 61px;
  border: 2px dashed #bdac71;
  border-radius: 15px;
  background: #fff4d6;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 6px 13px;
}
.queue strong {
  font-size: 12px;
  color: #8d7037;
}
.queue > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.queue time {
  font-size: 12px;
  color: #9c8553;
  font-variant-numeric: tabular-nums;
}
.text-button {
  border: 0;
  background: #eadcb3;
  border-radius: 9px;
  padding: 9px 13px;
  color: #806b3d;
  font-size: 12px;
  margin-left: auto;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #dccb98;
  border-top-color: #a98c3d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex: none;
}
.stage,
.result {
  position: absolute;
  inset: 90px 22px 24px;
  border-radius: 23px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #fffcf0ed;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.stage {
  background: #fffae8b0;
  pointer-events: none;
}
.stage strong {
  font-size: clamp(22px, 4vw, 36px);
  color: #476947;
  letter-spacing: -1px;
  margin: 15px 0 6px;
}
.stage p {
  font-size: 13px;
  line-height: 1.8;
  color: #748366;
  margin: 4px 0;
}
.stage.countdown {
  background: transparent;
  backdrop-filter: none;
}
.stage.countdown strong {
  font-size: 90px;
  line-height: 1.1;
  text-shadow:
    0 4px 0 #fff,
    0 0 30px #fff;
  color: #3e6751;
}
.stage.countdown p {
  background: #fff7dd;
  border-radius: 20px;
  padding: 5px 14px;
}
.result {
  animation: result-pop 0.3s ease-out;
  box-shadow: inset 0 0 0 2px #faf3d1;
}
.solo .result {
  inset: 0;
  aspect-ratio: auto;
  z-index: 7;
}
.solo .stage {
  inset: 92px 28px auto;
  aspect-ratio: 1;
}
.result-medal {
  font-size: 40px;
  color: #d7aa44;
  line-height: 1;
}
.result h2 {
  font-size: clamp(34px, 6vw, 56px);
  color: #3f8d62;
  letter-spacing: 1px;
  margin: 8px 0 2px;
  font-weight: 950;
}
.result.lose h2 {
  color: #ba695b;
}
.result.lose .result-medal {
  color: #d49a83;
}
.result time {
  font-size: 24px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  color: #7e895b;
  margin: 5px 0 9px;
}
.result p {
  font-size: 13px;
  line-height: 1.7;
  max-width: 350px;
  color: #879074;
  margin: 8px 0;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 11px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.result-actions button {
  font-size: 13px;
  padding: 10px 16px;
  min-height: 43px;
}
.arena.solved .board-shell {
  animation: success 0.38s ease-out;
}
.disconnect {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #fff4e6e8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  padding: 15px;
}
.disconnect strong {
  font-size: 14px;
  color: #a35748;
}
.disconnect span {
  font-size: 12px;
  color: #af846b;
}
.disconnect b {
  font-size: 45px;
  color: #bf7159;
  font-variant-numeric: tabular-nums;
}
.bottom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 27px auto 0;
  max-width: 680px;
}
.goal {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.goal > span {
  font-size: 10px;
  color: #8b947d;
}
.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, 14px);
  gap: 4px;
  font-size: 10px;
  text-align: center;
  color: #7e947d;
}
.privacy-note {
  text-align: center;
  font-size: 11px;
  color: #a1a690;
  line-height: 1.8;
  margin-top: 35px;
}
.site-footer {
  text-align: center;
  border-top: 1px solid #e8e5d9;
  font-size: 11px;
  color: #999f8f;
  padding: 21px;
  line-height: 1.8;
}
.site-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes result-pop {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes success {
  50% {
    filter: brightness(1.18);
  }
}
@media (max-width: 650px) {
  .nav {
    padding: 15px 12px;
  }
  .nav-links {
    gap: 9px;
    font-size: 10px;
  }
  .page {
    padding: 20px 14px 30px;
  }
  .welcome {
    padding: 8px 8px 25px;
    margin: 35px auto 24px;
  }
  .hero-symbol {
    margin-bottom: 22px;
  }
  .tagline {
    font-size: 14px;
  }
  .welcome h1 {
    font-size: 34px;
  }
  .toolbar {
    margin-top: 22px;
  }
  .play-title {
    font-size: 23px;
  }
  .arena {
    grid-template-columns: minmax(0, 1fr);
    max-width: 410px;
    padding: 21px 22px 25px;
    gap: 18px;
  }
  .arena.solo {
    padding: 21px 22px 25px;
  }
  .versus {
    font-size: 22px;
    line-height: 1;
  }
  .board-heading {
    margin-bottom: 14px;
  }
  .bottom-row {
    gap: 14px;
    flex-wrap: wrap;
  }
  .stage,
  .result {
    inset: 87px 22px 25px;
  }
  .solo .stage {
    inset: 87px 22px auto;
  }
  .solo .result {
    inset: 0;
    padding: 12px;
  }
  .solo .result-medal {
    font-size: 23px;
  }
  .solo .result h2 {
    font-size: 34px;
  }
  .result p {
    font-size: 12px;
  }
  .result-actions {
    margin-top: 11px;
  }
  .result-medal {
    font-size: 31px;
  }
  .result h2 {
    font-size: 40px;
  }
  .result time {
    font-size: 22px;
  }
  .stage.countdown strong {
    font-size: 72px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

.solo .result #result-detail {
  display: none;
}
.solo .result .result-actions {
  margin-top: 12px;
}
