/* KINGDOM FORGE — UI styles (Nunito, glass panels, mobile-first HUD) */
* { margin: 0; padding: 0; box-sizing: border-box; }

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("assets/fonts/Nunito-latin.woff2") format("woff2");
}

:root {
  --glass: rgba(13, 18, 30, 0.78);
  --glass-border: rgba(255, 255, 255, 0.14);
  --accent: #ffce63;
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --green: #4ade80;
  --red: #f87171;
  --text: #f3f6f9;
  --muted: #9fb0c3;
  --radius: 14px;
}

html, body {
  height: 100%;
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(120% 120% at 50% 0%, #1e2a44 0%, #0c1220 70%);
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Home / menu artwork background with a slow Ken Burns drift + ember ambience */
#menu-screen { position: fixed; overflow: hidden; }
#menu-screen::before {
  content: ""; position: absolute; inset: -6%; z-index: 0;
  background: url("assets/bg/home.webp") center / cover no-repeat;
  animation: kenburns 34s ease-in-out infinite alternate;
  will-change: transform;
}
#menu-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(7, 10, 18, 0.5), rgba(7, 10, 18, 0.8));
}
#menu-screen > .title-block { position: relative; z-index: 3; }
@keyframes kenburns {
  0%   { transform: scale(1.06) translate(0%, 0%); }
  100% { transform: scale(1.16) translate(-2.5%, -2%); }
}

/* Floating embers/sparkles drifting up over the artwork */
#bg-fx { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
#bg-fx .ember {
  position: absolute; bottom: -14px; border-radius: 50%;
  background: radial-gradient(circle, #ffd9a0, rgba(255, 160, 70, 0.15) 70%);
  box-shadow: 0 0 8px 1px rgba(255, 180, 90, 0.5);
  animation: ember-rise linear infinite;
}
@keyframes ember-rise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  10%  { opacity: 0.9; }
  85%  { opacity: 0.6; }
  100% { transform: translate(var(--drift, 24px), -106vh) scale(0.35); opacity: 0; }
}

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

button { font-family: inherit; color: var(--text); }

/* ---------- Title screens ---------- */
.title-block {
  text-align: center;
  padding: 34px 46px;
  background: var(--glass);
  border-radius: 26px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  max-width: 92vw;
  max-height: 92vh;
  overflow-y: auto;
}
.title-emoji {
  font-size: 64px; line-height: 1.1; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
  animation: emoji-float 4.5s ease-in-out infinite;
}
.brand-logo {
  display: block;
  width: clamp(96px, 16vw, 150px);
  height: auto;
  margin: 0 auto 2px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
  animation: emoji-float 4.5s ease-in-out infinite;
}
.brand-name {
  display: block;
  width: min(560px, 82vw);
  height: auto;
  margin: -4px auto 2px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}
@keyframes emoji-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-9px) rotate(2deg); }
}
.game-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 6px 0 2px;
  background: linear-gradient(90deg, var(--accent), #ff9d5c 35%, var(--violet) 60%, var(--accent));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-shimmer 7s linear infinite;
}
@keyframes title-shimmer { to { background-position: 220% center; } }
.subtitle { color: var(--muted); font-size: 16px; font-weight: 600; margin-bottom: 20px; }

/* Entrance animations when the menu appears */
@keyframes rise-in { from { opacity: 0; transform: translateY(16px) scale(0.99); } to { opacity: 1; transform: none; } }
.title-block { animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
.hero-card { animation: rise-in 0.5s ease backwards; }
.hero-card:nth-child(1) { animation-delay: 0.12s; }
.hero-card:nth-child(2) { animation-delay: 0.18s; }
.hero-card:nth-child(3) { animation-delay: 0.24s; }
.hero-card:nth-child(4) { animation-delay: 0.30s; }
.hero-card:nth-child(5) { animation-delay: 0.36s; }
.hero-card:nth-child(6) { animation-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
  #menu-screen::before, .title-emoji, .brand-logo, .game-title, .title-block,
  .hero-card, #bg-fx .ember { animation: none !important; }
}

.big-btn {
  display: block;
  width: 250px;
  max-width: 100%;
  margin: 10px auto;
  padding: 14px 20px;
  font-size: 18px;
  font-weight: 800;
  color: #1d1405;
  background: linear-gradient(135deg, #ffe19a, #ffb84d);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 184, 77, 0.35), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255, 184, 77, 0.45); }
.big-btn:active { transform: translateY(1px); }
.big-btn.secondary {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}

.menu-row { display: flex; gap: 10px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.chip-btn:hover { background: rgba(255,255,255,0.16); }
.chip-btn.connected { border-color: var(--green); color: var(--green); }
.chip-btn.danger { color: #ff9a9a; border-color: rgba(248,113,113,0.45); background: rgba(248,113,113,0.08); }
.chip-btn.danger:hover { background: rgba(248,113,113,0.16); }
.chip-btn.danger.armed { color: #fff; background: var(--red, #e44); border-color: var(--red, #e44); animation: reset-pulse 0.7s ease infinite; }
@keyframes reset-pulse { 50% { opacity: 0.7; } }

.rewards-note {
  margin-top: 18px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.14));
  border: 1px solid rgba(139, 92, 246, 0.35);
}
.rewards-note b { color: var(--accent); }
.rewards-note span { color: var(--muted); }

.save-info { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: -4px 0 10px; }
.save-info b { color: var(--green); }

#menu-screen .title-block {
  width: min(1120px, 94vw);
}

.api-console {
  display: grid;
  grid-template-columns: minmax(210px, 0.34fr) minmax(320px, 1fr);
  gap: 14px;
  margin: 18px auto 14px;
  text-align: left;
}

.api-sidebar,
.api-main,
.api-card {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(5, 10, 18, 0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.api-sidebar {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: 18px;
}

.api-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
  color: var(--text);
}

.api-brand b,
.api-brand small,
.api-endpoint b,
.api-endpoint small,
.api-card b,
.api-card small {
  display: block;
}

.api-brand small,
.api-endpoint small,
.api-card small,
.api-meta {
  color: var(--muted);
}

.api-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.7);
}

.api-endpoint {
  width: 100%;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.api-endpoint:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.1);
}

.api-endpoint.active {
  border-color: rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(139, 92, 246, 0.14));
}

.api-endpoint span,
.method-pill,
.api-card span {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 7px;
  border-radius: 7px;
  color: #061018;
  background: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.api-endpoint b {
  margin-top: 7px;
  font-size: 13.5px;
}

.api-main {
  min-width: 0;
  padding: 13px;
  border-radius: 18px;
}

.api-request {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
}

.method-pill { background: var(--cyan); }

.api-url {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: #dbeafe;
  background: rgba(255,255,255,0.07);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-send {
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  color: #111827;
  background: linear-gradient(135deg, #c4f96a, #55e2a1);
  font-weight: 900;
  cursor: pointer;
}

.api-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 2px;
  font-size: 12px;
  line-height: 1.4;
}

.api-response {
  height: 168px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  color: #c7f9d4;
  background: #050914;
  border: 1px solid rgba(74, 222, 128, 0.22);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

.api-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 11px;
}

.api-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto 14px;
  text-align: left;
}

.api-card {
  padding: 13px;
  border-radius: 16px;
}

.api-card span {
  color: #181305;
  background: var(--accent);
}

.api-card b {
  margin: 9px 0 4px;
  font-size: 14px;
}

.hero-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}
.hero-label { font-size: 14px; font-weight: 800; color: var(--ink); letter-spacing: 0.3px; }

/* Swipeable hero carousel (slider on phone/tablet, full row on desktop) */
.hero-carousel { position: relative; width: 100%; max-width: 540px; margin: 0 auto; }
.hero-cards {
  display: flex;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 2px;
}
.hero-cards::-webkit-scrollbar { display: none; }
.hc-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer;
  color: var(--text); background: rgba(10, 14, 24, 0.82);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, transform 0.1s;
}
.hc-nav:hover { background: rgba(22, 28, 44, 0.95); }
.hc-nav:active { transform: translateY(-50%) scale(0.92); }
.hc-nav.prev { left: -8px; }
.hc-nav.next { right: -8px; }
.hero-card {
  --hc: var(--accent);
  flex: 0 0 46%;
  scroll-snap-align: center;
  min-width: 0;
  padding: 9px 9px 11px;
  border-radius: 16px;
  cursor: pointer;
  background: rgba(10, 14, 24, 0.72);
  border: 2px solid var(--glass-border);
  color: var(--ink); font: inherit; text-align: center;
  display: flex; flex-direction: column; gap: 7px;
  position: relative;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.hero-card.barb { --hc: #ffb24d; }
.hero-card.mage { --hc: #6f8cff; }
.hero-card.guardian { --hc: #e0b341; }
.hero-card.assassin { --hc: #a78bfa; }
.hero-card.archer { --hc: #8ac559; }
.hero-card.druid { --hc: #5fc24d; }
.hero-card:hover { transform: translateY(-3px); border-color: var(--hc); }
.hero-card.active { border-color: var(--hc); box-shadow: 0 0 0 1.5px var(--hc), 0 14px 38px -10px var(--hc); }
.hc-top { display: flex; align-items: center; justify-content: center; }
.hc-name { font-weight: 900; font-size: 13.5px; white-space: nowrap; }
.hc-pick {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  font-size: 8.5px; font-weight: 900; color: #0a0e18; background: var(--hc);
  padding: 2px 6px; border-radius: 20px; white-space: nowrap;
  opacity: 0; transform: scale(0.8); transition: opacity 0.15s, transform 0.15s;
}
.hero-card.active .hc-pick { opacity: 1; transform: scale(1); }
.hc-art {
  border-radius: 11px; overflow: hidden; aspect-ratio: 3 / 4;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.06), #06090f);
  border: 1px solid var(--glass-border);
}
.hc-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.hc-stats { display: flex; flex-direction: column; gap: 4px; padding: 0 1px; }
.hc-stat { display: flex; align-items: center; gap: 7px; }
.hc-stat > span { font-size: 12px; width: 15px; flex: 0 0 auto; }
.hc-stat b { display: flex; gap: 3px; flex: 1; }
.hc-stat i { flex: 1; height: 7px; border-radius: 3px; background: rgba(255,255,255,0.12); }
.hc-stat i.on { background: var(--hc); box-shadow: 0 0 6px -1px var(--hc); }
.hc-role { font-size: 10.5px; font-weight: 900; color: var(--hc); margin-top: 1px; }
.hc-desc { font-size: 9.5px; color: var(--muted); line-height: 1.35; }
/* Phones: one full hero per slide */
@media (max-width: 560px) {
  .hero-carousel { max-width: 264px; }
  .hero-card { flex-basis: 100%; }
  .hc-art { aspect-ratio: auto; height: 280px; }
}
/* Tablet: ~3 cards across, still a slider */
@media (min-width: 561px) and (max-width: 899px) {
  .hero-card { flex-basis: 31%; }
}
/* Desktop: use the wide screen — all six heroes in one row, no slider */
@media (min-width: 900px) {
  .title-block { max-width: 1040px; padding: 38px 54px; }
  .hero-carousel { max-width: 100%; }
  .hero-cards {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
    overflow: visible; padding: 0;
  }
  .hc-nav { display: none; }
  .hc-name { font-size: 12.5px; }
  .hc-role { font-size: 11px; }
  .hc-desc { font-size: 10.5px; }
  .big-btn { width: 320px; }
}

.trade-list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; }
.trade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  font-size: 13.5px;
  font-weight: 700;
}
.trade-row button {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffe19a, #ffb84d);
  color: #1d1405;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.trade-row button:disabled { opacity: 0.4; cursor: default; }

#daily-desc { color: var(--cyan); font-weight: 700; font-size: 13px; line-height: 1.5; }
#daily-desc.done { color: var(--green); }
.board-row .vbadge { color: var(--green); font-size: 12px; }

.tab-row { display: flex; gap: 8px; justify-content: center; margin: 10px 0 2px; }
.tab-btn {
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: var(--ink-dim);
  font: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer;
}
.tab-btn.active { background: rgba(124,140,255,0.22); border-color: var(--accent); color: var(--ink); }

.milestone-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; text-align: left; max-height: 46vh; overflow-y: auto; }
.milestone-row {
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  font-size: 13px;
}
.milestone-row.done { border-color: var(--green); }
.milestone-row .m-head { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 5px; }
.milestone-row .m-reward { color: var(--accent); font-size: 12px; }
.milestone-row.done .m-reward { color: var(--green); }
.m-bar { height: 7px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.m-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 4px; }
.milestone-row.done .m-fill { background: var(--green); }

.loading-bar { width: 280px; max-width: 80vw; height: 12px; margin: 0 auto; background: rgba(255,255,255,0.1); border-radius: 6px; overflow: hidden; }
#loading-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 6px; transition: width 0.2s; }
.loading-tip { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(5, 8, 14, 0.65); backdrop-filter: blur(6px); padding: 16px; }
.modal-card {
  width: min(480px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 26px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  text-align: center;
}
.modal-card h2 { margin-bottom: 8px; font-size: 24px; font-weight: 900; }
.modal-card ul { text-align: left; list-style: none; line-height: 1.6; font-size: 14px; margin: 14px 0; }
.modal-card li { margin-bottom: 9px; }
.board-sub { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ---- How-to-Play guide ---- */
.guide-card { width: min(600px, 96vw); height: min(88vh, 700px); display: flex; flex-direction: column; overflow: hidden; text-align: left; padding: 20px 20px 18px; }
.guide-card h2 { text-align: center; }
.guide-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin: 6px 0 4px; scrollbar-width: none; }
.guide-tabs::-webkit-scrollbar { display: none; }
.gtab { flex: 0 0 auto; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); color: var(--ink-dim); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.gtab.active { background: rgba(124,140,255,0.22); border-color: var(--accent); color: var(--ink); }
.guide-body { flex: 1; overflow-y: auto; padding: 4px 2px 0; }
.guide-page h3 { font-size: 15px; font-weight: 900; color: var(--accent); margin: 15px 0 6px; }
.guide-page h3:first-child { margin-top: 4px; }
.guide-page p { font-size: 13.5px; line-height: 1.55; margin: 6px 0; color: var(--ink); }
.guide-page ul, .guide-page ol { line-height: 1.55; font-size: 13.5px; margin: 6px 0; padding-left: 19px; }
.guide-page ul { list-style: disc; }
.guide-page ol { list-style: decimal; }
.guide-page ul ul { margin: 5px 0; }
.guide-page li { margin-bottom: 6px; }
.guide-page b { color: var(--ink); }
.g-lead { color: var(--ink); font-weight: 600; }
.g-note { font-size: 12.5px; color: var(--muted); background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); border-radius: 10px; padding: 9px 11px; margin-top: 12px; line-height: 1.5; }
.guide-cards { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; }
.g-card { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); }
.g-card .g-ico { font-size: 20px; flex: 0 0 auto; }
.g-card .g-main { flex: 1; min-width: 0; }
.g-card .g-name { font-weight: 800; font-size: 13.5px; }
.g-card .g-cost { color: var(--accent); font-weight: 700; font-size: 11.5px; }
.g-card .g-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.g-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px; margin: 4px 4px 0 0; background: rgba(34,211,238,0.14); color: var(--cyan); }
.board-list { min-height: 120px; text-align: left; font-size: 14px; margin-bottom: 14px; }
.board-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; margin-bottom: 4px;
  background: rgba(255,255,255,0.05);
}
.board-row.me { background: rgba(255, 206, 99, 0.15); border: 1px solid rgba(255, 206, 99, 0.4); }
.board-row .rank { width: 32px; font-weight: 900; color: var(--accent); }
.board-row .wallet { flex: 1; font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.board-row .pts { font-weight: 800; }
.board-row .tok { font-size: 12px; font-weight: 700; color: var(--cyan); width: 90px; text-align: right; }

.tech-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.tech-item {
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  text-align: left;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.tech-item:hover { background: rgba(255,255,255,0.12); }
.tech-item.owned { border-color: var(--green); cursor: default; }
.tech-item.owned:hover { background: rgba(255,255,255,0.05); }
.tech-item .t-name { font-weight: 800; font-size: 13px; margin-bottom: 2px; }
.tech-item .t-desc { color: var(--muted); line-height: 1.4; margin-bottom: 4px; }
.tech-item .t-cost { color: var(--accent); font-weight: 800; }
.tech-item.owned .t-cost { color: var(--green); }

/* ---------- Guided onboarding ---------- */
#onb { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
#onb.hidden { display: none; }
#onb-spot {
  position: absolute; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(3, 6, 12, 0.72), 0 0 0 2px var(--accent), 0 0 22px 5px rgba(255, 206, 99, 0.5);
  transition: left 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), top 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), height 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  animation: onb-pulse 1.8s ease-in-out infinite;
}
#onb-spot.center { animation: none; box-shadow: 0 0 0 9999px rgba(3, 6, 12, 0.78); }
@keyframes onb-pulse {
  50% { box-shadow: 0 0 0 9999px rgba(3, 6, 12, 0.72), 0 0 0 2px var(--accent), 0 0 30px 9px rgba(255, 206, 99, 0.75); }
}
#onb-bubble {
  position: absolute; max-width: min(330px, 86vw); pointer-events: auto;
  background: rgba(13, 18, 30, 0.94); border: 1px solid var(--glass-border); border-radius: 16px;
  padding: 13px 16px 14px; color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 14px; line-height: 1.5;
}
#onb-step { font-size: 11px; font-weight: 800; color: var(--accent); letter-spacing: 0.4px; margin-bottom: 4px; }
#onb-text b { color: var(--accent); }
.onb-hint { margin-top: 8px; font-size: 12.5px; color: var(--cyan); font-weight: 700; }
.onb-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
#onb-skip { background: none; border: none; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 4px 0; }
#onb-skip:hover { color: var(--text); }
#onb-next {
  padding: 8px 18px; font-size: 13.5px; font-weight: 800; color: #1d1405; cursor: pointer;
  background: linear-gradient(135deg, #ffe19a, #ffb84d); border: none; border-radius: 11px;
  box-shadow: 0 4px 14px rgba(255, 184, 77, 0.35);
}
#onb-next:hover { filter: brightness(1.05); }
#onb-wait { font-size: 12.5px; font-weight: 800; color: var(--cyan); animation: onb-blink 1.2s ease-in-out infinite; }
@keyframes onb-blink { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  #onb-spot, #onb-wait { animation: none; }
}

/* ---------- Game HUD ---------- */
#game-screen { justify-content: flex-start; }
#game-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
@media (hover: hover) and (pointer: fine) {
  #game-screen.moving-building #game-canvas { cursor: move; }
}

#hud-top {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 10px; right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}
.hud-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}
.hud-row > * { pointer-events: auto; }

.res-panel {
  display: flex;
  gap: 12px;
  padding: 9px 14px;
  font-size: 14.5px;
  font-weight: 800;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.res-panel::-webkit-scrollbar { display: none; }
.res { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.res .ricon {
  width: 20px; height: 20px; flex: 0 0 auto; display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}
.res.flash { animation: flash-red 0.5s; }
@keyframes flash-red { 50% { color: var(--red); } }

.troop-panel {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.troop-panel::-webkit-scrollbar { display: none; }
.troop-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}
.troop-icon { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }

.points-panel { padding: 7px 14px; text-align: center; }
.points-row { font-size: 16px; font-weight: 900; color: var(--accent); }
.tokens-row { font-size: 11px; color: var(--cyan); font-weight: 800; }
.save-row { font-size: 10px; color: var(--green); font-weight: 800; min-height: 12px; opacity: 0; transition: opacity 0.4s; }
.save-row.show { opacity: 1; }

.hud-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  font-size: 15px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.18); }
.icon-btn.wide { font-size: 12.5px; font-weight: 800; }
.icon-btn.connected { border-color: var(--green); color: var(--green); }
.icon-btn.locked { opacity: 0.55; border-color: rgba(255,255,255,0.18); }

#quest-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 28px 8px 13px;
  max-width: 220px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  position: relative;
  color: inherit;
  font-family: inherit;
}
#quest-panel:hover { background: rgba(255,255,255,0.16); }
#quest-title { font-weight: 900; color: var(--accent); font-size: 12.5px; }
#quest-mini {
  color: var(--muted);
  line-height: 1.35;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* chevron hint that the quest panel opens a page */
#quest-panel::after {
  content: "›";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 900;
  color: var(--muted);
  line-height: 1;
}
/* attention dot while the daily task is still open */
.quest-dot { display: none; }
#quest-panel.attn .quest-dot {
  display: block;
  position: absolute;
  top: 7px;
  right: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
  animation: quest-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes quest-dot-pulse { 50% { opacity: 0.35; } }

/* quest modal blocks */
.quest-block {
  text-align: left;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.quest-block-head { font-weight: 900; color: var(--accent); margin-bottom: 5px; font-size: 14px; }
#quest-modal #quest-desc { color: var(--muted); line-height: 1.5; font-weight: 600; }
#quest-modal #quest-desc b { color: var(--text); }

#island-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.island-btn {
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.15s;
}
.island-btn.active { border-color: var(--accent); color: var(--accent); }
.island-btn.locked { opacity: 0.7; }
.island-btn .lock-cost { font-size: 10px; color: var(--accent); display: block; font-weight: 700; }

#time-indicator {
  margin-left: auto;
  font-size: 20px;
  pointer-events: none !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  align-self: center;
}

#raid-banner {
  position: fixed;
  top: 132px; left: 50%;
  transform: translateX(-50%);
  background: rgba(190, 30, 30, 0.92);
  border: 1px solid rgba(255, 120, 120, 0.6);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  padding: 9px 20px;
  border-radius: 14px;
  z-index: 11;
  animation: banner-pulse 0.7s infinite alternate;
  cursor: pointer;
  max-width: 92vw;
  text-align: center;
}
@keyframes banner-pulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.05); } }

#next-raid {
  position: fixed;
  bottom: 112px; left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  z-index: 10;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- Building info panel ---------- */
#binfo {
  position: fixed;
  right: 10px;
  bottom: calc(108px + env(safe-area-inset-bottom));
  z-index: 15;
  padding: 12px 15px;
  width: 240px;
  max-width: calc(100vw - 20px);
  font-size: 13px;
}
#binfo-title { font-weight: 900; font-size: 15px; margin-bottom: 3px; color: var(--accent); }
#binfo-stats { color: var(--muted); font-weight: 600; line-height: 1.5; margin-bottom: 9px; }
#binfo-stats b { color: var(--text); }
.binfo-xp { margin: -3px 0 9px; }
.binfo-xp #binfo-xp-label { font-size: 10.5px; font-weight: 800; color: var(--cyan); }
.binfo-xp i { display: block; height: 6px; margin-top: 3px; border-radius: 4px; background: rgba(255,255,255,0.12); overflow: hidden; }
.binfo-xp i b { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.binfo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.binfo-actions .chip-btn { padding: 7px 10px; font-size: 12px; }
.binfo-actions .chip-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- Move + 3D rotation controls ---------- */
#move-controls {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(650px, calc(100vw - 20px));
  max-width: calc(100vw - 16px);
  padding: 10px 12px;
  border-color: rgba(155, 231, 255, 0.32);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36), 0 0 24px rgba(34, 211, 238, 0.08);
}
.move-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#move-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}
#move-status::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #ffd27a;
  box-shadow: 0 0 10px rgba(255, 210, 122, 0.7);
}
#move-status.valid { color: #a8ffb8; }
#move-status.valid::before { background: #63f28a; box-shadow: 0 0 12px rgba(99, 242, 138, 0.9); }
#move-status.invalid { color: #ffaaaa; }
#move-status.invalid::before { background: #ff6a6a; box-shadow: 0 0 12px rgba(255, 106, 106, 0.85); }
.move-hint {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-hint b { color: var(--cyan); }
.move-actions { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
#move-controls .chip-btn {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
#move-controls .chip-btn:hover:not(:disabled) { transform: translateY(-1px); }
#move-controls .chip-btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
#move-controls .chip-btn:focus-visible {
  outline: 3px solid rgba(155, 231, 255, 0.78);
  outline-offset: 2px;
}
#move-confirm {
  color: #072d13;
  border-color: #63f28a;
  background: linear-gradient(180deg, #8cffaa, #45d974);
  box-shadow: 0 4px 15px rgba(69, 217, 116, 0.25);
}
#move-confirm:hover:not(:disabled) { background: linear-gradient(180deg, #a5ffbb, #55e383); }
#move-confirm:disabled {
  color: rgba(255,255,255,0.42);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.72;
}
#move-cancel { color: #ffc0c0; border-color: rgba(248, 113, 113, 0.4); }
#game-screen.moving-building #hud-bottom { display: none; }

/* ---------- Build palette ---------- */
#hud-bottom {
  position: fixed;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 7px;
  z-index: 10;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  scrollbar-width: none;
}
#hud-bottom::-webkit-scrollbar { display: none; }
.build-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 68px;
  flex-shrink: 0;
  padding: 7px 6px;
  background: rgba(255,255,255,0.06);
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.build-btn .b-icon { font-size: 23px; line-height: 1.15; }
.build-btn .b-cost { color: #ffd98a; font-size: 10px; font-weight: 700; }
.build-btn:hover { background: rgba(255,255,255,0.14); }
.build-btn.selected { border-color: var(--accent); background: rgba(255, 206, 99, 0.16); }
.build-btn.unaffordable { opacity: 0.4; }
.build-btn .b-lock { display: none; color: #ffd27a; font-size: 9.5px; font-weight: 800; }
.build-btn.locked { opacity: 0.5; filter: grayscale(0.85); cursor: not-allowed; }
.build-btn.locked .b-cost { display: none; }
.build-btn.locked .b-lock { display: block; }
.build-btn.locked:hover { background: rgba(255,255,255,0.06); }
/* Premium buildings: one-time ETH unlock (Robinhood Chain).
   The ETH price badge and tooltip line are hidden so premium buildings look like
   normal ones — the purchase/payment logic still runs on click. */
.build-btn .b-eth { display: none; }
.tip-eth { display: none; }
.build-btn.premium { border-color: rgba(153,69,255,0.45); }
.build-btn.premium:hover { background: rgba(153,69,255,0.16); }
.build-btn.eth-locked { opacity: 1; filter: none; cursor: pointer; }
.build-btn.owned { border-color: rgba(20,241,149,0.5); }
.village-badge {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  padding: 6px 11px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,206,99,0.22), rgba(255,206,99,0.07));
  border: 2px solid rgba(255,206,99,0.5);
  font-size: 11px; font-weight: 800; color: #ffe9b8; white-space: nowrap;
}
.village-badge b { font-weight: 900; }

#tooltip {
  position: fixed;
  z-index: 70;
  max-width: 250px;
  background: var(--glass);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: none;
  backdrop-filter: blur(14px);
}
#tooltip b { color: var(--accent); }

#toast {
  position: fixed;
  bottom: calc(118px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  z-index: 80;
  max-width: 92vw;
  text-align: center;
  backdrop-filter: blur(14px);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* ---------- End screen ---------- */
#end-screen { background: rgba(5, 8, 14, 0.7); z-index: 40; backdrop-filter: blur(8px); }
.end-stats { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.end-stat {
  padding: 12px 22px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
}
.end-stat span { display: block; font-size: 25px; font-weight: 900; color: var(--accent); }
.end-stat label { font-size: 12px; font-weight: 700; color: var(--muted); }
.submit-status { font-size: 13px; font-weight: 700; color: var(--cyan); min-height: 18px; margin-bottom: 6px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  #hud-top { left: 8px; right: 8px; gap: 6px; }
  .hud-row { gap: 6px; }
  .res-panel {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 11px;
    font-size: 12.5px;
    order: 0;
  }
  .points-panel { padding: 6px 11px; order: 1; }
  .troop-panel { order: 1; flex: 1 1 auto; padding: 6px 8px; gap: 5px; font-size: 11px; }
  .troop-counter { min-width: 36px; padding: 3px 6px; }
  .points-row { font-size: 13.5px; }
  .tokens-row { font-size: 10px; }
  #quest-panel { order: 2; }
  .hud-actions { order: 3; margin-left: auto; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  /* uniform square icon buttons — wide buttons collapse to icon-only so the row stays tidy */
  .icon-btn, .icon-btn.wide {
    padding: 6px 0; min-width: 34px; font-size: 14px; font-weight: 700;
    border-radius: 10px; text-align: center; line-height: 1.15;
  }
  .icon-btn .btn-label { display: none; }

  #quest-panel { max-width: 44vw; font-size: 10.5px; padding: 6px 24px 6px 10px; }
  #quest-title { font-size: 11px; }
  #quest-panel::after { right: 8px; font-size: 15px; }
  .island-btn { padding: 6px 9px; font-size: 11px; border-radius: 10px; }
  .island-btn .lock-cost { font-size: 9px; }
  #time-indicator { font-size: 17px; }

  #raid-banner { top: 170px; font-size: 13px; padding: 8px 14px; }
  #next-raid { font-size: 11px; bottom: 102px; }
  #binfo { bottom: calc(98px + env(safe-area-inset-bottom)); width: 220px; }
  #toast { bottom: calc(106px + env(safe-area-inset-bottom)); font-size: 12.5px; }
  #move-controls {
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    gap: 8px;
    width: calc(100vw - 16px);
    padding: 9px;
    border-radius: 16px;
  }
  .move-copy { align-items: center; text-align: center; }
  #move-status { font-size: 12px; }
  .move-hint { max-width: 100%; font-size: 10px; }
  .move-actions { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #move-controls .chip-btn {
    min-width: 0;
    min-height: 46px;
    padding: 7px 5px;
    flex-direction: column;
    gap: 3px;
    font-size: 16px;
  }
  #move-controls .chip-btn span { font-size: 9.5px; }

  .build-btn { min-width: 58px; padding: 6px 4px; font-size: 9.5px; }
  .build-btn .b-icon { font-size: 20px; }
  .build-btn .b-cost { font-size: 9px; }

  .game-title { font-size: 32px; }
  .title-block { padding: 24px 20px; }
  .title-emoji { font-size: 52px; }
  .brand-logo { width: 92px; }
  .brand-name { width: min(390px, 88vw); }
  .api-console { grid-template-columns: 1fr; }
  .api-sidebar { max-height: 190px; overflow-y: auto; }
  .api-request { grid-template-columns: 1fr; }
  .method-pill { justify-self: start; }
  .api-send { width: 100%; }
  .api-meta { flex-direction: column; gap: 4px; }
  .api-response { height: 150px; }
  .api-actions { justify-content: stretch; }
  .api-actions .chip-btn { flex: 1; }
  .api-cards { grid-template-columns: 1fr; }
  .tech-list { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .res-panel { font-size: 11.5px; gap: 6px; }
  #quest-panel { max-width: 44vw; }
  #move-controls { width: calc(100vw - 12px); padding: 8px 7px; }
  .move-actions { gap: 4px; }
  #move-controls .chip-btn { min-height: 44px; }
}

/* ---------- PvP / Attack mode ---------- */
#pvp-screen { position: fixed; overflow: hidden; }
#pvp-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(rgba(7,10,18,0.55), rgba(7,10,18,0.8)),
              url("assets/bg/pvp.webp") center / cover no-repeat;
}
.pvp-view { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; }
.pvp-view.hidden { display: none; }
.pvp-card { position: relative; z-index: 2; max-width: 460px; }
.pvp-trophy-row { display: flex; justify-content: center; gap: 26px; margin: 6px 0 14px; }
.pvp-stat { display: flex; flex-direction: column; align-items: center; }
.pvp-stat span { font-size: 26px; font-weight: 900; color: var(--accent); }
.pvp-stat label { font-size: 11px; font-weight: 700; color: var(--muted); }
.pvp-opponent {
  text-align: left; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; min-height: 70px; font-size: 13.5px; line-height: 1.5;
}
.pvp-opponent.loading { color: var(--muted); text-align: center; }
.pvp-opp-name { font-weight: 900; font-size: 16px; color: var(--text); }
.pvp-opp-line { color: var(--muted); margin-top: 4px; }
.pvp-opp-tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 20px; margin-top: 6px; background: rgba(248,113,113,0.18); color: var(--red); }

/* Battle */
#pvp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 1; }
#pvp-hud {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 3;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pvp-hud-stat {
  font-weight: 900; font-size: 15px; padding: 8px 13px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(12px);
}
.pvp-stars { display: flex; gap: 3px; font-size: 22px; line-height: 1; }
.pvp-stars span { color: rgba(255,255,255,0.22); text-shadow: 0 1px 2px rgba(0,0,0,0.5); transition: color 0.3s, transform 0.3s; }
.pvp-stars span.on { color: #ffd34d; transform: scale(1.15); text-shadow: 0 0 10px rgba(255,211,77,0.8); }
.pvp-stars.big { font-size: 46px; gap: 8px; justify-content: center; margin: 8px 0 14px; }
#pvp-surrender { margin-left: auto; }
#pvp-hud .pvp-hud-stat:first-child {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  padding: 2px 16px;
  color: #fff;
  background: transparent;
  border: 0;
  text-shadow: 0 4px 0 #2b2b2b, 0 0 8px rgba(0,0,0,0.75);
  backdrop-filter: none;
}
#pvp-hud .pvp-hud-stat:nth-child(2) {
  background: rgba(26, 31, 42, 0.88);
}
#pvp-army {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(20, 16, 22, 0.1), rgba(22, 17, 21, 0.92) 22%, rgba(13, 12, 16, 0.98));
  border-top: 2px solid rgba(255,255,255,0.18);
}
.pvp-troop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 78px; height: 96px; padding: 7px 8px; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, #f7f4ec 0%, #d3d0cb 58%, #a29d98 100%);
  border: 3px solid #2b2d35;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 8px 18px rgba(0,0,0,0.42);
  color: #1f2937;
  font-weight: 900; font-size: 11px; transition: border-color 0.15s, transform 0.1s, filter 0.15s;
}
.pvp-troop .pt-icon { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 1px rgba(0,0,0,0.3)); }
.pvp-troop .pt-count { min-width: 34px; padding: 2px 7px; border-radius: 10px; font-size: 13px; color: #fff; background: #1f2937; }
.pvp-troop.active { border-color: #facc15; box-shadow: inset 0 2px 0 rgba(255,255,255,0.7), 0 0 0 3px rgba(250,204,21,0.8), 0 10px 22px rgba(0,0,0,0.48); }
.pvp-troop.empty { opacity: 0.4; }
.pvp-troop:active { transform: scale(0.95); }
.pvp-deploy-hint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 120px; z-index: 3;
  background: rgba(7,10,18,0.85); border: 1px solid var(--glass-border); color: var(--cyan);
  font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 20px; pointer-events: none;
  animation: onb-blink 1.6s ease-in-out infinite;
}
.pvp-deploy-hint.hidden { display: none; }
