:root {
  --bg: #f4efe6;
  --ink: #201a14;
  --muted: #6d6258;
  --panel: rgba(255, 252, 247, 0.94);
  --border: rgba(32, 26, 20, 0.12);
  --orange: #d97706;
  --orange-dark: #b45309;
  --green: #2f855a;
  --blue: #2563eb;
  --red: #dc2626;
  --shadow: 0 18px 45px rgba(39, 27, 18, 0.12);
  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(217, 119, 6, 0.13), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(37, 99, 235, 0.1), transparent 26%),
    linear-gradient(180deg, #f9f4ec 0%, #efe7d9 100%);
}

.shell {
  width: min(1320px, calc(100% - 32px));
  margin: 24px auto 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--orange-dark);
  font-weight: 800;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
}

.hero p {
  max-width: 760px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.5;
}

.pill {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1.05fr 1.4fr;
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card h2,
.card h3 {
  margin: 0 0 12px;
}

.subtle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.field-grid,
.mini-grid,
.dragon-grid,
.join-grid,
.action-grid,
.team-editor {
  display: grid;
  gap: 12px;
}

.field-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dragon-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.join-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.team-editor {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(32, 26, 20, 0.13);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(39, 27, 18, 0.12);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary {
  background: linear-gradient(135deg, var(--orange), #ea580c);
  color: white;
  padding: 12px 16px;
  font-weight: 800;
}

.secondary {
  background: #f1ebe2;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.metric {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(32, 26, 20, 0.08);
  border-radius: 16px;
  padding: 14px;
}

.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
}

.status {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-weight: 700;
}

.status.live {
  background: rgba(47, 133, 90, 0.12);
  color: var(--green);
}

.status.over {
  background: rgba(220, 38, 38, 0.1);
  color: var(--red);
}

.teams-list,
.standings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.player-team-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.player-team-column {
  border: 1px solid rgba(32, 26, 20, 0.08);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.62);
}

.player-team-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
}

.player-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(217, 119, 6, 0.1);
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
}

.player-chip-draggable {
  border: none;
  cursor: grab;
}

.player-chip-draggable:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(39, 27, 18, 0.1);
}

.player-chip-active {
  opacity: 0.55;
  cursor: grabbing;
}

.player-chip-empty {
  background: rgba(32, 26, 20, 0.06);
  color: var(--muted);
}

.player-chip-waiting {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.player-team-column-over {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 247, 237, 0.92);
  box-shadow: inset 0 0 0 2px rgba(217, 119, 6, 0.12);
}

.team-card,
.dragon-card {
  border: 1px solid rgba(32, 26, 20, 0.08);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.team-head,
.dragon-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.team-name,
.dragon-name {
  font-size: 20px;
  font-weight: 800;
}

.small {
  font-size: 13px;
  color: var(--muted);
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 800;
}

.alert-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.alert-badge {
  background: rgba(220, 38, 38, 0.16);
  color: #fca5a5;
}

#alert-panel {
  border: 1px solid rgba(248, 113, 113, 0.42);
  background:
    radial-gradient(circle at top right, rgba(239, 68, 68, 0.22), transparent 34%),
    linear-gradient(160deg, rgba(72, 16, 16, 0.98), rgba(33, 10, 20, 0.98));
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.08), 0 18px 40px rgba(0, 0, 0, 0.36);
}

#alert-panel.alert-live {
  animation: alert-pulse 1.15s ease-in-out infinite;
}

.alert-kicker {
  color: #fecaca;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.alert-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #fca5a5, #dc2626);
  color: #fff7ed;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.45);
}

.alert-badge {
  min-width: 64px;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff1f2;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.96), rgba(249, 115, 22, 0.88));
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.32);
}

#alert-copy {
  background: rgba(127, 29, 29, 0.42);
  color: #fff1f2;
  border: 1px solid rgba(248, 113, 113, 0.26);
  font-size: 15px;
}

#alert-penalty {
  color: #fecaca;
  font-weight: 700;
}

#alert-action-btn {
  width: 100%;
  min-height: 54px;
  font-size: 18px;
  letter-spacing: 0.4px;
  box-shadow: 0 0 28px rgba(249, 115, 22, 0.22);
}

#alert-action-btn:hover:not(:disabled) {
  box-shadow: 0 0 36px rgba(248, 113, 113, 0.36);
}

@keyframes alert-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.18), 0 18px 40px rgba(0, 0, 0, 0.36); }
  50% { transform: scale(1.01); box-shadow: 0 0 0 10px rgba(248, 113, 113, 0.03), 0 22px 48px rgba(0, 0, 0, 0.42); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.18), 0 18px 40px rgba(0, 0, 0, 0.36); }
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 74px 1fr 54px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(32, 26, 20, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.bar-fill.good {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.bar-fill.warn {
  background: linear-gradient(90deg, #eab308, #f59e0b);
}

.bar-fill.bad {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.action-btn {
  padding: 14px 10px;
  background: white;
  border: 1px solid rgba(32, 26, 20, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 92px;
}

.action-title {
  font-size: 14px;
  font-weight: 800;
}

.action-copy {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.callout {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(217, 119, 6, 0.1);
  color: var(--orange-dark);
  font-weight: 700;
}

.hidden {
  display: none;
}

.empty {
  padding: 16px;
  border: 1px dashed rgba(32, 26, 20, 0.18);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .grid,
  .field-grid,
  .mini-grid,
  .join-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }
}

.player-shell {
  display: grid;
  grid-template-columns: minmax(260px, 30vw) minmax(340px, 1fr);
  gap: 14px;
}

body.player-page {
  background:
    radial-gradient(ellipse at 15% 35%, rgba(76, 29, 149, 0.38) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 18%, rgba(127, 29, 29, 0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 92%, rgba(30, 58, 138, 0.2) 0%, transparent 52%),
    #0a0818;
  color: #e2d9f3;
}

body.player-page .card,
body.player-page .pill,
body.player-page .metric,
body.player-page .team-card,
body.player-page .dragon-card {
  background: linear-gradient(160deg, rgba(23, 16, 53, 0.96), rgba(16, 11, 36, 0.96));
  border-color: rgba(139, 92, 246, 0.18);
  color: #e2d9f3;
}

body.player-page .subtle,
body.player-page .small,
body.player-page .metric-label,
body.player-page label {
  color: #9d8cc3;
}

body.player-page input,
body.player-page select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f7f2ff;
}

body.player-page .callout {
  background: rgba(251, 191, 36, 0.08);
  color: #f3d98d;
}

body.player-page .empty {
  border-color: rgba(255, 255, 255, 0.12);
  color: #9d8cc3;
}

.dragon-stage {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 22px;
  min-height: 58vh;
  position: sticky;
  top: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  flex-direction: column;
}

.dragon-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 100%, rgba(249, 115, 22, 0.1), transparent 58%);
}

.dragon-display {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dragon-art,
.dragon-video {
  width: min(100%, 27vw, 680px);
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.dragon-video.hidden,
.dragon-art.hidden,
.overlay.hidden,
.modal.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.dragon-art.egg {
  animation: wobble 2s ease-in-out infinite;
}

.original-game .dragon-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.original-game .dragon-display {
  min-height: 48vh;
}

.dragon-status-line {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-size: 12px;
  color: #7b6f92;
  font-style: italic;
  text-align: center;
  min-height: 18px;
}

.original-game .bars {
  margin-top: 18px;
}

.dragon-art.happy {
  animation: bounce 0.6s ease-in-out infinite alternate;
}

.dragon-art.sick,
.dragon-video.sick {
  filter: hue-rotate(100deg) brightness(0.8);
}

.dragon-art.dead,
.dragon-video.dead {
  filter: grayscale(1) brightness(0.4);
}

.overlay {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 28px;
  z-index: 2;
}

.player-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.player-main > .game-panel {
  min-width: 0;
}

.player-main > .game-panel:not(#bonus-panel):not(#mission-panel) {
  grid-column: 1 / -1;
}

#bonus-panel,
#mission-panel {
  align-self: stretch;
}

#stats-panel {
  order: 4;
}

#boss-panel {
  order: 5;
}

#actions-panel {
  order: 6;
}

#bonus-panel {
  order: 7;
}

#mission-panel {
  order: 8;
}

#standings-panel {
  order: 9;
}

.game-panel {
  background: linear-gradient(160deg, rgba(23, 16, 53, 0.96), rgba(16, 11, 36, 0.96));
  border-color: rgba(139, 92, 246, 0.18);
  padding: 14px;
}

.xp-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.xp-row strong {
  color: #f3d98d;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bonus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.bonus-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#mission-panel .actions {
  margin-top: 10px !important;
}

#mission-panel .primary {
  width: 100%;
}

.bonus-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bonus-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(251, 191, 36, 0.15);
  font-size: 18px;
}

.bonus-name {
  font-size: 13px;
  font-weight: 800;
  color: #f7f2ff;
}

.bonus-desc {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
  color: #c7bfe0;
}

.duration-btn {
  background: #f1ebe2;
  color: var(--ink);
  border: 2px solid var(--border);
  padding: 8px 14px;
  font-size: .85em;
  font-weight: 700;
  border-radius: 10px;
}

.duration-btn.active {
  background: linear-gradient(135deg, var(--orange), #ea580c);
  color: white;
  border-color: transparent;
}

.bonus-use-btn {
  width: 100%;
}

.bonus-empty {
  grid-column: 1 / -1;
}

.dragon-bonus-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  padding: 0 4px 10px;
  position: relative;
  z-index: 2;
}

.dragon-bonus-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(249, 115, 22, 0.14);
  border: 1.5px solid rgba(249, 115, 22, 0.45);
  border-radius: 20px;
  padding: 5px 14px 5px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #3b1a6b;
  transition: background 0.15s, transform 0.1s;
}

.dragon-bonus-chip:hover {
  background: rgba(249, 115, 22, 0.28);
  transform: translateY(-1px);
}

.dragon-bonus-chip:active {
  transform: scale(0.96);
}

.dragon-bonus-chip-icon {
  font-size: 16px;
  line-height: 1;
}

.dragon-bonus-chip--loot {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
}

.dragon-bonus-chip--loot:hover {
  background: rgba(34, 197, 94, 0.28);
}

/* ── Streak toast ── */
@keyframes streak-pop-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes streak-pop-out {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}

.streak-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
}

.streak-toast.hidden {
  display: none;
}

.streak-toast.pop-in {
  animation: streak-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.streak-toast.pop-out {
  animation: streak-pop-out 0.3s ease-in forwards;
}

.streak-toast-inner {
  background: linear-gradient(135deg, #1e1033 0%, #3b1a6b 100%);
  border: 2px solid rgba(249, 115, 22, 0.7);
  border-radius: 20px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(249, 115, 22, 0.4), 0 0 0 1px rgba(255,255,255,0.08);
  min-width: 220px;
}

.streak-toast-fire {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.8));
}

.streak-toast-streak {
  font-size: 22px;
  font-weight: 900;
  color: #f97316;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.streak-toast-label {
  font-size: 12px;
  color: #c7bfe0;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.streak-toast-item {
  font-size: 20px;
  font-weight: 800;
  color: #f7f2ff;
}

.streak-toast.super .streak-toast-inner {
  background: linear-gradient(135deg, #1a1200 0%, #4a3000 50%, #2a1800 100%);
  border: 2px solid rgba(255, 200, 0, 0.9);
  box-shadow: 0 8px 40px rgba(255, 200, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.12), 0 0 60px rgba(255, 160, 0, 0.3);
}

.streak-toast.super .streak-toast-streak {
  color: #ffd700;
  font-size: 26px;
  text-shadow: 0 0 12px rgba(255, 200, 0, 0.8);
}

.streak-toast.super .streak-toast-fire {
  filter: drop-shadow(0 0 16px rgba(255, 200, 0, 0.9));
}

.streak-toast-chest {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin: 4px auto 8px;
  display: block;
  filter: drop-shadow(0 0 12px rgba(255, 200, 0, 0.6));
  animation: chest-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.streak-toast-chest.hidden {
  display: none;
}

@keyframes chest-bounce {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.streak-toast.super .streak-toast-item {
  color: #ffe57a;
  font-size: 22px;
}

.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.stat-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
  font-size: 12px;
}

.action-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.action-tile {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 88px;
  text-align: center;
}

.action-tile .icon {
  font-size: 21px;
}

.action-tile .label {
  font-size: 14px;
  font-weight: 800;
  color: #f7f2ff;
}

.action-tile .desc {
  font-size: 11px;
  color: #d8c9f4;
}

#actions-panel h2,
#standings-panel h2 {
  margin-bottom: 8px !important;
}

#actions-panel .callout,
#team-status-copy,
#alert-copy {
  margin-top: 10px !important;
}

.team-name {
  font-size: clamp(18px, 2vw, 22px);
}

.badge {
  padding: 8px 12px;
  font-size: 12px;
}

.callout {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .player-shell {
    grid-template-columns: minmax(220px, 36vw) minmax(320px, 1fr);
    align-items: start;
  }

  .dragon-stage {
    position: sticky;
    top: 12px;
    min-height: 52vh;
    justify-content: center;
    padding: 12px;
  }

  .original-game .dragon-display {
    min-height: 40vh;
    align-items: center;
  }

  .dragon-art,
  .dragon-video {
    width: min(100%, 32vw, 360px);
    max-height: 44vh;
  }

  .dragon-status-line {
    margin-top: 8px;
  }
}

@media (max-width: 900px) {
  .player-shell {
    grid-template-columns: 1fr;
  }

  .dragon-stage {
    position: relative;
    top: 0;
    min-height: 34vh;
    justify-content: flex-start;
    padding: 12px 12px 10px;
  }

  .original-game .dragon-display {
    min-height: 28vh;
    align-items: flex-start;
  }

  .dragon-art,
  .dragon-video {
    width: min(100%, 58vw, 420px);
    max-height: 30vh;
  }

  .dragon-status-line {
    margin-top: 4px;
  }

  .player-main {
    grid-template-columns: 1fr;
  }

  .player-main > .game-panel,
  .player-main > .game-panel:not(#bonus-panel):not(#mission-panel) {
    grid-column: 1;
  }

  .action-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .boss-box {
    padding: 18px;
    max-width: 98vw;
    width: 98vw;
    max-height: 96dvh;
  }

  .boss-board {
    gap: 5px;
  }

  .boss-gem {
    font-size: 20px;
    border-radius: 10px;
  }

  #boss-modal {
    align-items: flex-start;
    justify-content: stretch;
    padding: 8px;
  }
}

/* Stat bar colors — each stat has its own color */
.bar-fill.stat-hunger    { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar-fill.stat-happiness { background: linear-gradient(90deg, #be185d, #f0abfc); }
.bar-fill.stat-energy    { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.bar-fill.stat-health    { background: linear-gradient(90deg, #16a34a, #22c55e); }
.bar-fill.stat-care      { background: linear-gradient(90deg, #0d9488, #2dd4bf); }

/* Action button borders match their stat bar color */
.action-feed     { border-color: rgba(251, 191, 36, 0.85);  border-width: 2px; }  /* gul-amber — sult */
.action-play     { border-color: rgba(240, 171, 252, 0.85); border-width: 2px; }  /* lyslilla-pink — glæde */
.action-sleep    { border-color: rgba(59, 130, 246, 0.8);   border-width: 2px; }  /* blå — energi */
.action-medicine { border-color: rgba(34, 197, 94, 0.8);    border-width: 2px; }  /* grøn — helbred */
.action-care     { border-color: rgba(45, 212, 191, 0.8);   border-width: 2px; }  /* teal — pleje */
.action-study    { border-color: rgba(139, 92, 246, 0.8);   border-width: 2px; }  /* lilla — XP */

.action-tile:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(124, 58, 237, 0.1);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.16);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.82);
}

#challenge-modal,
#boss-modal {
  z-index: 50;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: opacity 0.25s;
}

.modal-box {
  background: linear-gradient(160deg, #1a1040, #2d1b69);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(124, 58, 237, 0.2);
  animation: modal-pop 0.25s cubic-bezier(.34, 1.56, .64, 1);
}

.mission-box {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(160deg, #1f163f, #32205a);
}

.boss-box {
  max-width: 560px;
  border-color: rgba(248, 113, 113, 0.45);
  background: linear-gradient(160deg, #241131, #3a1423);
  max-height: min(92dvh, 860px);
  overflow-y: auto;
}

.boss-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.boss-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.boss-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.boss-right .boss-bonus {
  margin-bottom: 0;
}

.boss-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.boss-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 320px;
}

.boss-gem {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.boss-gem.selected {
  outline: 2px solid #f59e0b;
  transform: translateY(-1px);
}

.boss-gem.cursed {
  background: linear-gradient(160deg, rgba(63, 28, 79, 0.96), rgba(22, 12, 31, 0.96));
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: inset 0 0 0 2px rgba(91, 33, 182, 0.18);
  position: relative;
}

.boss-gem.cursed::after {
  content: "✦";
  position: absolute;
  inset: auto 6px 4px auto;
  font-size: 10px;
  color: #d8b4fe;
}

.boss-gem.valid-target {
  outline: 2px solid rgba(74, 222, 128, 0.85);
}

.boss-help {
  font-size: 12px;
  color: #d4c4ea;
  text-align: center;
  margin-bottom: 10px;
}

.boss-bonus {
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.08);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

#boss-bonus-question {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 10px;
}

#boss-shadow-question {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  margin: 8px 0 10px;
}

#boss-bonus-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#boss-shadow-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.boss-actions {
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  margin-top: 8px;
  background: linear-gradient(180deg, rgba(36, 17, 49, 0), rgba(36, 17, 49, 0.96) 28%);
}

#boss-submit-btn,
#boss-reset-btn {
  min-width: 140px;
}

#boss-result {
  margin-top: 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

#boss-result.r-correct { color: #4ade80; }
#boss-result.r-wrong { color: #fca5a5; }

@keyframes modal-pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-icon {
  font-size: 34px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #c4b5fd;
}

.modal-sub {
  font-size: 12px;
  color: #8b7cb3;
}

#timer-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin-bottom: 18px;
  overflow: hidden;
}

#timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: #22c55e;
}

#chal-question {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-line;
  line-height: 1.3;
}

#chal-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.coordinate-challenge {
  margin-bottom: 14px;
}

.coordinate-copy {
  font-size: 13px;
  color: #d8c9f4;
  text-align: center;
  margin-bottom: 10px;
}

.coordinate-board {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: 24px 1fr;
  gap: 6px;
  align-items: stretch;
}

.coordinate-corner {
  grid-column: 1;
  grid-row: 1;
}

.coordinate-axis-x {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 4px;
  font-size: 11px;
  color: #b6a8d7;
}

.coordinate-axis-x span,
.coordinate-axis-y span {
  display: grid;
  place-items: center;
  font-weight: 700;
}

.coordinate-axis-y {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: repeat(11, minmax(0, 1fr));
  gap: 4px;
  font-size: 11px;
  color: #b6a8d7;
}

.coordinate-grid {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(0, 1fr));
  gap: 4px;
}

.coordinate-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #f7f2ff;
  display: grid;
  place-items: center;
  font-size: 14px;
  padding: 0;
}

.coordinate-cell:hover:not(:disabled) {
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(45, 212, 191, 0.55);
}

.coordinate-cell.selected {
  background: rgba(45, 212, 191, 0.26);
  border-color: #2dd4bf;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.18);
}

.coordinate-cell.completed {
  background: rgba(74, 222, 128, 0.16);
  border-color: rgba(74, 222, 128, 0.52);
  color: #86efac;
}

#chal-choice-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.choice-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 13px 8px;
  color: #f7f2ff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.choice-btn:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.5);
}

.choice-btn.selected {
  background: rgba(124, 58, 237, 0.4);
  border-color: #7c3aed;
  color: #c4b5fd;
}

#btn-choice-submit {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

#btn-choice-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

#btn-choice-submit:active {
  transform: scale(0.98);
}

#btn-choice-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#chal-result {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  padding: 8px;
  border-radius: 8px;
  animation: result-pop 0.3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes result-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#chal-result.r-correct { color: #4ade80; }
#chal-result.r-wrong { color: #f87171; }
#chal-result.r-timeout { color: #fbbf24; }

.modal-hint {
  font-size: 11px;
  color: #8b7cb3;
  text-align: center;
  margin-top: 6px;
}

.food-box {
  background: linear-gradient(160deg, #1c0f08, #3d1a00);
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(249, 115, 22, 0.12);
  animation: modal-pop 0.25s cubic-bezier(.34, 1.56, .64, 1);
}

.food-hd,
.sleep-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.food-hd-title {
  font-size: 18px;
  font-weight: 700;
  color: #fdba74;
}

.food-close,
.challenge-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  padding: 6px 11px;
  color: #f7f2ff;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  transition: background 0.15s;
}

.food-close:hover,
.challenge-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.fm-section {
  margin-top: 14px;
}

.fm-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fdba74;
  margin-bottom: 10px;
}

#fm-recipe-count {
  color: #fbbf24;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inv-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: border-color 0.2s;
}

.inv-item.has-stock {
  border-color: rgba(249, 115, 22, 0.35);
}

.inv-emoji {
  font-size: 26px;
}

.inv-name {
  font-size: 10px;
  color: #b6a8d7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.inv-count {
  font-size: 15px;
  font-weight: 700;
}

.inv-value {
  font-size: 10px;
  color: #4ade80;
}

.inv-feed-btn {
  margin-top: 4px;
  width: 100%;
  background: linear-gradient(135deg, #ea580c, #b91c1c);
  border: none;
  border-radius: 7px;
  padding: 5px 4px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}

.inv-feed-btn:hover:not(:disabled) {
  transform: scale(1.04);
}

.inv-feed-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hunt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hunt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 6px;
  color: #f7f2ff;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.hunt-btn:hover {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.45);
  transform: translateY(-2px);
}

.hunt-icon {
  font-size: 24px;
}

.hunt-label {
  font-size: 12px;
  font-weight: 700;
}

.hunt-diff {
  font-size: 10px;
  color: #b6a8d7;
}

.recipe-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.recipe-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-card.known {
  border-color: rgba(251, 191, 36, 0.3);
}

.recipe-card.locked {
  opacity: 0.55;
}

.recipe-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.recipe-lock-ico {
  text-align: center;
  font-size: 22px;
}

.recipe-lock-hint {
  font-size: 11px;
  color: #b6a8d7;
  text-align: center;
  font-style: italic;
}

.sleep-box {
  background: linear-gradient(160deg, #081422, #11233d);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(59, 130, 246, 0.12);
  animation: modal-pop 0.25s cubic-bezier(.34, 1.56, .64, 1);
}

.play-box {
  background: linear-gradient(160deg, #22100f, #3b1614);
  border-color: rgba(251, 146, 60, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(249, 115, 22, 0.12);
}

.study-box {
  background: linear-gradient(160deg, #15102d, #24164b);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.12);
}

.care-box {
  background: linear-gradient(160deg, #082123, #0f3638);
  border-color: rgba(45, 212, 191, 0.38);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(45, 212, 191, 0.1);
}

.care-hd-title {
  color: #99f6e4;
}

.care-task-btn:hover {
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.45);
}

.care-grid {
  grid-template-columns: 1fr 1fr;
}

.sleep-hd-title {
  font-size: 18px;
  font-weight: 700;
  color: #93c5fd;
}

.play-hd-title {
  color: #fdba74;
}

.study-hd-title {
  color: #c4b5fd;
}

.sleep-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sleep-task-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 12px;
  color: #f7f2ff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
}

.sleep-task-btn:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.45);
  transform: translateY(-2px);
}

.play-task-btn:hover {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(251, 146, 60, 0.45);
}

.study-task-btn:hover {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.45);
}

.sleep-task-icon {
  font-size: 24px;
}

.sleep-task-label {
  font-size: 14px;
  font-weight: 800;
}

.sleep-task-desc {
  font-size: 11px;
  color: #b6a8d7;
  line-height: 1.4;
}

.victory-box {
  background: linear-gradient(180deg, rgba(56, 34, 8, 0.98), rgba(22, 13, 2, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.38);
  border-radius: 24px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.58), 0 0 60px rgba(251, 191, 36, 0.12);
  width: min(100%, 520px);
  padding: 26px 24px 24px;
  text-align: center;
}

.victory-burst {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
}

.victory-kicker {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #fbbf24;
  font-weight: 800;
}

.victory-title {
  font-size: 30px;
  font-weight: 900;
  margin-top: 8px;
}

.victory-team {
  font-size: 24px;
  font-weight: 800;
  color: #fde68a;
  margin-top: 10px;
}

.victory-copy {
  font-size: 14px;
  line-height: 1.55;
  color: #f7f2ff;
  margin: 14px 0 18px;
}

.victory-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.victory-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.victory-link {
  text-decoration: none;
}

.victory-stat {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 10px;
}

.victory-stat-label {
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #b6a8d7;
}

.victory-stat-value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 5px;
}

#round-outcome-close {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

#round-outcome-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

#round-outcome-new-game {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 12px 18px;
  color: #e8d9c0;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

#round-outcome-new-game:hover {
  background: rgba(255,255,255,.14);
  transform: translateY(-1px);
}

@keyframes wobble {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px) scale(1.04); }
}

@media (max-width: 980px) {
  .player-shell,
  .stats-grid,
  .action-cards,
  .sleep-options,
  .feed-options {
    grid-template-columns: 1fr;
  }

  .dragon-stage {
    min-height: 320px;
    position: static;
  }

  .coordinate-board {
    grid-template-columns: 22px 1fr;
    grid-template-rows: 20px 1fr;
    gap: 3px;
  }

  .coordinate-grid,
  .coordinate-axis-x {
    gap: 3px;
  }

  .coordinate-cell {
    border-radius: 6px;
    font-size: 11px;
  }

  .care-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Coin & Shop ──────────────────────────────────────────────────────────── */
.coin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(32,26,20,.08);
}

.coin-balance {
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 5px;
}

.coin-icon { font-size: 1.1rem; }

.coin-shop-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: none;
  background: linear-gradient(135deg, #d97706, #ea580c);
  color: #fff;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.coin-shop-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(217,119,6,.35); }

/* Shop modal */
.shop-box {
  background: #1e1610;
  border-radius: 22px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.shop-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f7f0e6;
  margin-bottom: 4px;
}

.shop-balance {
  font-size: .85rem;
  color: #c8a87a;
}

.shop-close-btn {
  background: none;
  border: none;
  color: #9a8070;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-item {
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.shop-item-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.shop-item-body { flex: 1; min-width: 0; }

.shop-item-name {
  font-size: .95rem;
  font-weight: 800;
  color: #f7f0e6;
  margin-bottom: 2px;
}

.shop-item-desc {
  font-size: .78rem;
  color: #9a8878;
  line-height: 1.35;
}

.shop-buy-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 99px;
  border: none;
  background: linear-gradient(135deg, #d97706, #ea580c);
  color: #fff;
  font: inherit;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s, opacity .15s;
}
.shop-buy-btn:hover:not(:disabled) { transform: translateY(-1px); }
.shop-buy-btn:disabled { opacity: .38; cursor: not-allowed; }

/* Coin toast */
.coin-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,22,16,.92);
  color: #f7c948;
  border: 1.5px solid rgba(247,201,72,.3);
  border-radius: 99px;
  padding: 7px 18px;
  font-size: .88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9999;
  pointer-events: none;
  animation: coin-pop 2s ease forwards;
}
.coin-toast.hidden { display: none; }
.coin-toast-icon { font-size: 1.1rem; }

@keyframes coin-pop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
