:root {
  color-scheme: light;
  --ink: #241b38;
  --sky: #47ccff;
  --cream: #fff9df;
  --pink: #ff5d8f;
  --pink-dark: #d92f68;
  --mango: #ffb228;
  --mint: #35d5a4;
  --grape: #9468ff;
  --blue: #2388ef;
  --panel: rgba(255, 255, 255, 0.94);
  --shadow: 0 12px 0 rgba(47, 35, 74, 0.16), 0 20px 48px rgba(31, 77, 116, 0.24);
  font-family: "Arial Rounded MT Bold", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #2eabdf;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  touch-action: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  isolation: isolate;
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hidden {
  display: none !important;
}

.panel {
  position: absolute;
  z-index: 5;
  background: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.home-panel {
  left: max(22px, env(safe-area-inset-left));
  top: 50%;
  width: min(520px, 45vw);
  max-height: calc(100% - 32px);
  padding: 20px 24px 16px;
  transform: translateY(-50%);
  overflow: auto;
}

.logo-lockup {
  position: relative;
  text-align: center;
}

.logo-kicker {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: 10px;
  letter-spacing: 0.12em;
}

h1 {
  margin: 7px 0 1px;
  font-size: clamp(27px, 3.2vw, 45px);
  line-height: 1;
  letter-spacing: -0.07em;
  transform: rotate(-1deg);
  text-shadow: 0 4px 0 white, 0 7px 0 rgba(36, 27, 56, 0.16);
}

h1 span {
  color: var(--pink);
  -webkit-text-stroke: 1.5px var(--ink);
}

.logo-lockup p,
.micro-copy {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.67;
}

.profile-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.name-field {
  flex: 1;
}

.name-field span {
  display: block;
  margin: 0 0 4px 4px;
  font-size: 11px;
  font-weight: 900;
}

.name-field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 3px solid var(--ink);
  border-radius: 13px;
  outline: none;
  background: #fffdf4;
  font-size: 15px;
  font-weight: 900;
  user-select: text;
}

.name-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(35, 136, 239, 0.18);
}

.round-button {
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff2a8;
  box-shadow: 0 4px 0 var(--ink);
}

.wallet-pill {
  display: flex;
  height: 42px;
  min-width: 72px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff0a6;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 13px;
  font-weight: 1000;
}

.play-pass-strip {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: linear-gradient(90deg, #dffaff, #fff0a6);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 10px;
  font-weight: 1000;
}

.play-pass-strip strong {
  color: var(--pink-dark);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.play-pass-strip small {
  justify-self: end;
  font-size: 9px;
  opacity: 0.66;
}

.character-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.character {
  padding: 7px 4px 6px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: white;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 120ms ease, background 120ms ease;
}

.character:hover,
.character.selected {
  transform: translateY(-3px) rotate(-2deg);
  background: #fff0a6;
}

.character b {
  display: block;
  font-size: 27px;
  line-height: 1;
}

.character span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 900;
}

.studio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 11px;
}

.studio-button {
  min-height: 34px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fffdf4;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 11px;
  font-weight: 1000;
}

.daily-reward-button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -3px 0 11px;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: linear-gradient(135deg, #fff0a6, #ffc5df);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 10px;
  font-weight: 1000;
}

.daily-reward-button strong { color: var(--pink-dark); }

.privacy-options-button {
  display: block;
  margin: 6px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  text-decoration: underline;
  opacity: 0.62;
}

.ad-status-copy {
  margin: 5px 0 0;
  color: #276c79;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.mode-button {
  position: relative;
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: white;
  box-shadow: 0 5px 0 var(--ink);
  text-align: left;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.mode-button:hover {
  transform: translateY(-2px);
}

.mode-button:active,
.control-button.pressed,
.mini-control.pressed {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 1px 0 var(--ink);
}

.mode-button.primary { background: linear-gradient(135deg, #59d5ff, #83f2dd); }
.mode-button.mango { background: linear-gradient(135deg, #ffc33f, #ff8e66); }
.mode-button.mint { background: linear-gradient(135deg, #72f0b9, #c6fa72); }
.mode-button.grape { background: linear-gradient(135deg, #b9a0ff, #ff99d4); }

.mode-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 0 white);
}

.mode-button strong,
.mode-button small {
  display: block;
}

.mode-button strong {
  font-size: 14px;
  line-height: 1.1;
}

.mode-button small {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 800;
  opacity: 0.65;
}

.mode-button em {
  position: absolute;
  right: 7px;
  top: -8px;
  padding: 3px 6px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--pink);
  color: white;
  font-size: 8px;
  font-style: normal;
}

.hud {
  position: absolute;
  z-index: 4;
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.play-time-floating {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: max(82px, calc(env(safe-area-inset-top) + 70px));
  min-width: 72px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 246, 170, 0.94);
  box-shadow: 0 3px 0 var(--ink);
  font-size: 11px;
  font-weight: 1000;
  text-align: center;
  transform: translateX(-50%);
}

.play-time-floating strong { font-variant-numeric: tabular-nums; }
.play-time-floating.danger { background: #ff9fb5; animation: pulse-time 0.7s infinite alternate; }
@keyframes pulse-time { to { transform: translateX(-50%) scale(1.08); } }

.player-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 0 rgba(36, 27, 56, 0.9);
}

.player-card-right {
  justify-content: flex-end;
  text-align: right;
}

.avatar {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff0a8;
  font-size: 23px;
}

.player-info {
  width: min(220px, 22vw);
  min-width: 70px;
}

.player-info strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter {
  height: 8px;
  margin-top: 4px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #eadff1;
}

.meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #27d7a4, #ffe143);
  transition: width 80ms linear;
}

.score-pips {
  flex: 0 0 auto;
  color: var(--pink);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 1px;
}

.round-badge {
  display: grid;
  width: 60px;
  height: 60px;
  place-content: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff3a3;
  box-shadow: 0 5px 0 var(--ink);
  text-align: center;
  transform: rotate(3deg);
}

.round-badge small {
  font-size: 8px;
  line-height: 1;
}

.round-badge strong {
  font-size: 22px;
  line-height: 1;
}

.controls {
  position: absolute;
  z-index: 4;
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
}

.single-controls {
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.control-button {
  width: clamp(125px, 17vw, 210px);
  min-height: 78px;
  border: 4px solid var(--ink);
  border-radius: 25px;
  box-shadow: 0 8px 0 var(--ink), 0 14px 24px rgba(36, 27, 56, 0.25);
  pointer-events: auto;
}

.control-button.guard { background: linear-gradient(145deg, #7ce9ff, #38aaf4); }
.control-button.attack { background: linear-gradient(145deg, #ff89ac, #ff3d72); }

.control-button span,
.control-button strong,
.control-button small {
  display: block;
}

.control-button span { font-size: 27px; line-height: 1; }
.control-button strong { margin-top: 2px; font-size: 17px; }
.control-button small { font-size: 8px; font-weight: 900; opacity: 0.72; }

.local-controls {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.local-side {
  display: flex;
  gap: 10px;
}

.local-p2 {
  flex-direction: row-reverse;
}

.mini-control {
  width: clamp(82px, 11vw, 125px);
  height: 65px;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
  font-size: 21px;
}

.mini-control.guard { background: #65d9ff; }
.mini-control.attack { background: #ff628f; }
.mini-control b { display: block; font-size: 11px; }

.exit-button {
  position: absolute;
  z-index: 6;
  top: max(82px, calc(env(safe-area-inset-top) + 76px));
  right: max(16px, env(safe-area-inset-right));
  width: 38px;
  height: 38px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 0 var(--ink);
  font-size: 25px;
  line-height: 1;
}

.search-panel,
.result-panel,
.utility-panel {
  left: 50%;
  top: 50%;
  width: min(420px, calc(100% - 36px));
  padding: 25px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.online-lobby-panel {
  width: min(560px, calc(100% - 28px));
  padding: 24px;
  text-align: left;
}

.online-lobby-panel > h2,
.online-lobby-panel > p { text-align: left; }

.online-lobby-panel > h2 {
  margin-top: 9px;
  font-size: clamp(28px, 4vw, 39px);
}

.lobby-profile-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 13px;
  border: 3px solid rgba(36, 27, 56, 0.28);
  border-radius: 14px;
  background: #fffdf7;
  font-size: 11px;
  font-weight: 900;
}

.lobby-profile-line strong { color: #276c79; }

.lobby-main-button {
  width: 100%;
  min-height: 54px;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: linear-gradient(135deg, #ff5d8f, #ff966f);
  color: white;
  box-shadow: 0 6px 0 var(--ink);
  font-size: 16px;
  font-weight: 1000;
}

.lobby-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.lobby-create-grid button {
  min-height: 58px;
  padding: 8px;
  border: 3px solid var(--ink);
  border-radius: 15px;
  background: #fffdf7;
  box-shadow: 0 4px 0 rgba(36, 27, 56, 0.24);
  font-size: 12px;
  font-weight: 1000;
}

.lobby-create-grid button:last-child { background: #dff9ff; }
.lobby-create-grid small { display: block; margin-top: 3px; font-size: 9px; opacity: 0.62; }

.comic-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 17px 0 9px;
  color: rgba(36, 27, 56, 0.55);
  font-size: 10px;
  font-weight: 1000;
  text-align: center;
}

.comic-divider::before,
.comic-divider::after { height: 2px; flex: 1; content: ""; background: rgba(36, 27, 56, 0.14); }

.room-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
}

.room-list-head button {
  border: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  text-decoration: underline;
}

.online-room-list {
  max-height: 142px;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 3px solid rgba(36, 27, 56, 0.15);
  border-radius: 17px;
  background: #fffdf7;
  list-style: none;
}

.online-room-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-bottom: 2px solid rgba(36, 27, 56, 0.1);
}

.online-room-list li:last-child { border-bottom: 0; }
.online-room-list .room-empty { display: block; padding: 20px; font-size: 10px; font-weight: 900; text-align: center; opacity: 0.6; }
.room-avatar { font-size: 23px; }
.room-meta strong, .room-meta small { display: block; }
.room-meta strong { font-size: 11px; }
.room-meta small { margin-top: 2px; font-size: 9px; opacity: 0.6; }
.room-join-button {
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff0a6;
  box-shadow: 0 2px 0 var(--ink);
  font-size: 10px;
  font-weight: 1000;
}

.room-code-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 9px;
}

.room-code-form label span { display: block; margin: 0 0 4px 3px; font-size: 10px; font-weight: 1000; }
.room-code-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  outline: none;
  background: white;
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: 0.25em;
  user-select: text;
}

.room-code-form button {
  height: 48px;
  padding: 0 15px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--mango);
  box-shadow: 0 4px 0 var(--ink);
  font-size: 11px;
  font-weight: 1000;
}

.lobby-footnote { margin: 12px 0 0 !important; font-size: 9px !important; text-align: center !important; }

.search-room-code {
  display: block;
  margin: -5px auto 11px;
  padding: 8px 13px;
  border: 2px dashed var(--ink);
  border-radius: 12px;
  background: #fff0a6;
  font-size: 11px;
  font-weight: 900;
}

.search-room-code strong { color: var(--pink-dark); font-size: 18px; letter-spacing: 0.12em; }

.result-panel {
  max-height: calc(100% - 28px);
  overflow: auto;
}

.utility-panel {
  left: 50%;
  top: 50%;
  width: min(460px, calc(100% - 36px));
  max-height: calc(100% - 28px);
  padding: 22px;
  overflow: auto;
  text-align: center;
  transform: translate(-50%, -50%);
}

.utility-panel h2 {
  margin: 7px 0 3px;
  font-size: 28px;
  letter-spacing: -0.05em;
}

.utility-panel > p {
  margin: 4px 0 12px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.7;
}

.play-pass-panel {
  z-index: 12;
  width: min(430px, calc(100% - 30px));
  background: linear-gradient(155deg, #fffdf4, #dbf8ff 48%, #ffe0a3);
}

.play-pass-panel > p strong { color: var(--pink-dark); font-size: 16px; }

.play-pass-battery {
  position: relative;
  display: grid;
  width: 92px;
  height: 58px;
  place-items: center;
  margin: 8px auto 4px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: white;
  font-size: 32px;
  overflow: hidden;
}

.play-pass-battery::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 8px;
  height: 22px;
  border: 3px solid var(--ink);
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: white;
}

.play-pass-battery i {
  position: absolute;
  inset: auto 0 0;
  height: 8px;
  background: var(--pink);
}

.play-pass-ad-button,
.play-pass-free-button {
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 13px;
  font-weight: 1000;
}

.play-pass-ad-button { background: linear-gradient(135deg, #ff6688, #ff9a65); color: white; }
.play-pass-free-button { background: #e6fbff; }
.play-pass-panel button:disabled { filter: grayscale(0.65); opacity: 0.65; }
.play-pass-panel > small { display: block; margin-top: 12px; font-size: 9px; font-weight: 800; opacity: 0.65; }

.panel-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 22px;
}

.panel-kicker {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--mint);
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

#photo-preview {
  display: block;
  width: min(100%, 320px);
  height: 220px;
  margin: 8px auto 12px;
  border: 3px dashed var(--ink);
  border-radius: 20px;
  background: linear-gradient(45deg, #edf0f4 25%, transparent 25%), linear-gradient(-45deg, #edf0f4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf0f4 75%), linear-gradient(-45deg, transparent 75%, #edf0f4 75%), white;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  object-fit: contain;
}

.photo-actions,
.utility-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.file-button {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff0a6;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
}

.sensitivity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
  font-size: 11px;
  font-weight: 1000;
}

.sensitivity-row input {
  flex: 1;
  accent-color: var(--pink);
}

.status-copy {
  min-height: 17px;
}

.utility-actions .big-button {
  grid-column: auto;
}

.leaderboard-list {
  min-height: 180px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 8px 11px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fffdf3;
  font-size: 12px;
  font-weight: 900;
}

.leaderboard-list li:nth-child(1) { background: #fff0a4; }
.leaderboard-list li:nth-child(2) { background: #e9f0f5; }
.leaderboard-list li:nth-child(3) { background: #ffd5ae; }

.leaderboard-list em {
  font-style: normal;
  color: var(--pink-dark);
}

.search-panel h2,
.result-panel h2 {
  margin: 9px 0 5px;
  font-size: clamp(24px, 4vw, 35px);
  letter-spacing: -0.06em;
}

.search-panel p,
.result-panel p {
  margin: 0 0 15px;
  font-size: 13px;
  font-weight: 800;
  opacity: 0.68;
}

.radar {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  margin: 0 auto;
  place-items: center;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #b9f2ff 0 10px, #6dd9ef 11px 12px);
}

.radar::before {
  position: absolute;
  width: 50%;
  height: 50%;
  content: "";
  transform-origin: 100% 100%;
  animation: radar 1.15s linear infinite;
  background: linear-gradient(30deg, transparent, rgba(255, 255, 255, 0.85));
}

.radar b { z-index: 1; font-size: 34px; }
@keyframes radar { to { transform: rotate(360deg); } }

.search-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 11px 0;
}

.search-dots i {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: bounce 0.8s infinite alternate;
  background: var(--pink);
}

.search-dots i:nth-child(2) { animation-delay: 0.15s; }
.search-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { to { transform: translateY(-8px); background: var(--mango); } }

.result-sticker {
  display: block;
  font-size: 57px;
  animation: victory 0.65s ease-in-out infinite alternate;
}

@keyframes victory { to { transform: translateY(-7px) rotate(6deg) scale(1.08); } }

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.result-reward-summary {
  width: fit-content;
  margin: -5px auto 12px;
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff4b7;
  font-size: 12px;
  font-weight: 900;
}

.result-reward-summary strong { color: var(--pink-dark); }

.reward-offer {
  margin: 0 0 12px;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(135deg, #e4fbff, #fff0a6);
  box-shadow: 0 4px 0 var(--ink);
}

.reward-offer > span,
.reward-offer > strong,
.reward-offer > small {
  display: block;
}

.reward-offer > span {
  color: var(--pink-dark);
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.reward-offer > strong {
  margin: 3px 0 7px;
  font-size: 16px;
}

.reward-offer button {
  width: 100%;
  min-height: 40px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--pink);
  color: white;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 12px;
  font-weight: 1000;
}

.reward-offer button:disabled { filter: grayscale(0.6); opacity: 0.7; }
.reward-offer > small { margin-top: 6px; font-size: 9px; font-weight: 800; opacity: 0.65; }

.big-button,
.secondary-button,
.text-button {
  min-height: 44px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-weight: 1000;
}

.big-button {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #ffcc45, #ff6d92);
  box-shadow: 0 5px 0 var(--ink);
  font-size: 18px;
}

.secondary-button {
  padding: 8px 12px;
  background: #dff9ff;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 12px;
}

.text-button {
  grid-column: 1 / -1;
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
}

.toast {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 18px;
  max-width: min(480px, calc(100% - 32px));
  padding: 10px 17px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.35);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
}

.test-ad-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 17, 38, 0.82);
}

.test-ad-card {
  width: min(390px, 100%);
  padding: 28px 22px;
  border: 4px solid var(--ink);
  border-radius: 24px;
  background: linear-gradient(155deg, #c6f5ff, #fff2a8 55%, #ffc0d8);
  box-shadow: 0 10px 0 #171126;
  text-align: center;
}

.test-ad-card span,
.test-ad-card strong,
.test-ad-card p { display: block; }
.test-ad-card span { font-size: 9px; font-weight: 1000; letter-spacing: 0.15em; }
.test-ad-card strong { margin: 16px 0 8px; font-size: 22px; }
.test-ad-card p { font-size: 11px; font-weight: 800; opacity: 0.7; }
.test-ad-card button {
  width: 100%;
  min-height: 45px;
  margin-top: 8px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--pink);
  color: white;
  box-shadow: 0 4px 0 var(--ink);
  font-size: 13px;
  font-weight: 1000;
}
.test-ad-card button:disabled { background: #9c91ad; }
.test-ad-card .test-ad-cancel { min-height: 32px; border: 0; background: transparent; color: var(--ink); box-shadow: none; font-size: 10px; text-decoration: underline; }

.orientation-tip {
  display: none;
}

@media (max-width: 900px) {
  .home-panel {
    width: min(470px, 54vw);
    padding: 14px 17px 12px;
  }
  .mode-button { min-height: 57px; }
  .mode-icon { font-size: 22px; }
  .character b { font-size: 22px; }
}

@media (orientation: portrait) {
  #app { min-height: 100%; }
  .home-panel {
    left: 50%;
    top: 52%;
    width: min(92vw, 520px);
    transform: translate(-50%, -50%);
  }
  .orientation-tip {
    position: absolute;
    z-index: 7;
    left: 50%;
    top: 9px;
    display: block;
    padding: 7px 12px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: #fff5a7;
    font-size: 10px;
    font-weight: 900;
    transform: translateX(-50%);
  }
  .controls { bottom: max(12px, env(safe-area-inset-bottom)); }
  .control-button { width: 39vw; min-height: 72px; }
  .hud { gap: 5px; left: 7px; right: 7px; top: 38px; }
  .player-card { padding: 5px; gap: 4px; }
  .avatar { width: 30px; height: 30px; font-size: 17px; }
  .score-pips { display: none; }
  .round-badge { width: 44px; height: 44px; }
  .round-badge strong { font-size: 17px; }
  .local-side { gap: 5px; }
  .mini-control { width: 20vw; height: 61px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .home-panel { padding: 11px 16px 9px; }
  .logo-lockup p, .micro-copy { display: none; }
  .profile-row { margin-top: 7px; }
  .play-pass-strip { margin-top: 6px; padding: 4px 9px; }
  .character-picker { margin: 7px 0; }
  .character { padding: 4px; }
  .character b { display: inline; font-size: 19px; }
  .character span { display: inline; margin-left: 3px; }
  .mode-button { min-height: 50px; padding: 6px 8px; }
  .control-button { min-height: 67px; }
}
