:root {
  color-scheme: light;
  --bg-top: #fff4d6;
  --bg-bottom: #ffd8c8;
  --panel: rgba(255, 250, 242, 0.8);
  --panel-strong: rgba(255, 253, 249, 0.95);
  --line: rgba(48, 32, 26, 0.12);
  --ink: #241612;
  --muted: #705951;
  --hot: #ff6b6b;
  --gold: #ffb703;
  --mint: #3ecf8e;
  --sky: #5bc0eb;
  --shadow: 0 24px 60px rgba(130, 71, 29, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Trebuchet MS", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 183, 77, 0.55), transparent 28%),
    radial-gradient(circle at 100% 10%, rgba(91, 192, 235, 0.35), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 107, 107, 0.24), transparent 26%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1360px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 34px;
}

.hero-panel,
.game-panel,
.join-card,
.arena-card,
.side-card {
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel,
.game-panel {
  background: var(--panel);
  border-radius: 30px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.35fr minmax(280px, 420px);
  gap: 22px;
  padding: 28px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b65338;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  max-width: 9ch;
}

h2 {
  font-size: 1.05rem;
}

.hero-text {
  max-width: 54ch;
  line-height: 1.65;
  color: var(--muted);
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-tags span,
.hud-chip,
.badge {
  border-radius: 999px;
}

.hero-tags span {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.join-card {
  display: grid;
  gap: 14px;
  align-self: start;
  padding: 18px;
  border-radius: 24px;
  background: var(--panel-strong);
}

.join-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.join-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.join-card button,
.action-buttons button,
#mobile-dash {
  background: linear-gradient(135deg, #ff7b54, #ff4d6d);
  color: white;
}

button.ghost {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost.accent,
#mobile-prank {
  background: linear-gradient(135deg, #3ecf8e, #00b4d8);
  color: #052634;
}

.join-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.game-panel {
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.room-meta,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.online {
  background: rgba(62, 207, 142, 0.14);
  color: #0f7f4d;
}

.badge.connecting {
  background: rgba(255, 183, 3, 0.18);
  color: #9a6400;
}

.badge.offline {
  background: rgba(82, 96, 110, 0.15);
  color: #52606e;
}

.arena-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
}

.arena-card,
.side-card {
  background: var(--panel-strong);
  border-radius: 24px;
}

.arena-card {
  padding: 14px;
}

.arena {
  position: relative;
  min-height: 68vh;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(45, 28, 19, 0.1);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.16), transparent 40%),
    linear-gradient(180deg, #34211d, #1d1313);
}

.arena.shake {
  animation: arena-shake 420ms ease;
}

.arena-grid,
.snack-layer,
.player-layer,
.fx-layer {
  position: absolute;
  inset: 0;
}

.arena-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.5;
}

.arena-hud {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: none;
}

.hud-chip {
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 250, 244, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 14px;
}

.player,
.snack,
.burst {
  position: absolute;
  transform: translate(-50%, -50%);
}

.player {
  transition: transform 70ms linear;
}

.player-body {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.player.self .player-body {
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.14),
    0 0 0 16px rgba(255, 183, 3, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.player.dashing .player-body {
  animation: pulse 260ms ease infinite alternate;
}

.player-name {
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #201310;
  font-size: 12px;
  white-space: nowrap;
}

.snack {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6bf, #ffb703 62%, #ff8800);
  box-shadow:
    0 0 0 6px rgba(255, 183, 3, 0.08),
    0 8px 20px rgba(255, 136, 0, 0.32);
  color: rgba(98, 45, 0, 0.92);
  font-size: 14px;
  animation: floaty 1.8s ease-in-out infinite;
}

.burst {
  pointer-events: none;
  color: #fff4d6;
  font-weight: 700;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  animation: burst-up 900ms ease forwards;
}

.side-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.side-card {
  padding: 16px;
}

.leaderboard,
.event-feed,
.tips {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.leaderboard li,
.event-feed li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(36, 22, 18, 0.08);
}

.leaderboard li:last-child,
.event-feed li:last-child {
  border-bottom: 0;
}

.leaderboard strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rank-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.event-feed li {
  display: grid;
  gap: 4px;
}

.event-feed span {
  font-size: 12px;
  color: var(--muted);
}

.tips li + li {
  margin-top: 10px;
}

.mobile-controls {
  display: none;
  gap: 16px;
  justify-content: space-between;
  align-items: end;
  margin-top: 16px;
}

.pad {
  display: grid;
  gap: 10px;
}

.pad-row {
  display: flex;
  gap: 10px;
}

.mobile-controls button {
  min-width: 72px;
}

.action-buttons {
  display: grid;
  gap: 10px;
}

@keyframes floaty {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-6px);
  }
}

@keyframes burst-up {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -115%) scale(1.15);
  }
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.18);
  }
}

@keyframes arena-shake {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  20% {
    transform: translate3d(-6px, 3px, 0);
  }

  40% {
    transform: translate3d(7px, -4px, 0);
  }

  60% {
    transform: translate3d(-5px, -2px, 0);
  }

  80% {
    transform: translate3d(6px, 3px, 0);
  }
}

@media (max-width: 980px) {
  .hero-panel,
  .arena-layout {
    grid-template-columns: 1fr;
  }

  .arena {
    min-height: 54vh;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 12px;
  }

  .hero-panel,
  .game-panel {
    border-radius: 24px;
  }

  .hero-panel {
    padding: 18px;
  }

  .mobile-controls {
    display: flex;
  }
}
