/* ---------- Design Tokens ---------- */
:root {
  --bg-deep: #0f0a1f;
  --bg-mid: #1a1130;
  --panel: #2c1854;
  --panel-alt: #3a1f6b;
  --accent: #a855f7;
  --accent-bright: #d8b4fe;
  --accent-dim: #6d28d9;
  --gold: #fbbf24;
  --text: #f3eefc;
  --muted: #b6a2d6;
  --danger: #fb7185;
  --success: #34d399;
  --radius: 14px;
  --font-display: 'Cinzel', serif;
  --font-body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg-deep);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(168,85,247,0.18), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(251,191,36,0.08), transparent 40%);
  color: var(--text);
  position: relative;
}

.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 60% 40% at 50% -10%, rgba(168,85,247,0.25), transparent 60%);
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(58,31,107,0.9), rgba(15,10,31,0.6));
  border-bottom: 1px solid rgba(216,180,254,0.15);
  flex-wrap: wrap;
  gap: 10px;
}
.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.03em;
  color: var(--accent-bright);
  text-shadow: 0 0 18px rgba(168,85,247,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}
.crest { color: var(--gold); }

.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(216,180,254,0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
}
.chip-amount { color: var(--gold); }
.chip-badge.chip-flash-win { animation: chipWin 0.6s ease; }
.chip-badge.chip-flash-lose { animation: chipLose 0.6s ease; }
@keyframes chipWin {
  0% { box-shadow: 0 0 0 rgba(52,211,153,0); }
  35% { box-shadow: 0 0 20px rgba(52,211,153,0.85); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 rgba(52,211,153,0); transform: scale(1); }
}
@keyframes chipLose {
  0% { box-shadow: 0 0 0 rgba(251,113,133,0); }
  35% { box-shadow: 0 0 20px rgba(251,113,133,0.85); transform: scale(0.97); }
  100% { box-shadow: 0 0 0 rgba(251,113,133,0); transform: scale(1); }
}

button {
  font-family: var(--font-body);
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(109,40,217,0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(168,85,247,0.55); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.icon-btn, .ghost-btn {
  background: transparent;
  border: 1px solid rgba(216,180,254,0.35);
  box-shadow: none;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.icon-btn:hover:not(:disabled), .ghost-btn:hover:not(:disabled) { background: rgba(168,85,247,0.15); transform: none; }

.primary-btn {
  background: linear-gradient(160deg, var(--gold), #d97706);
  color: #2b1405;
  box-shadow: 0 4px 16px rgba(251,191,36,0.35);
}
.primary-btn:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(251,191,36,0.5); }

/* ---------- Tabs ---------- */
.tabs {
  position: relative;
  z-index: 1;
  display: flex;
  background: rgba(15,10,31,0.6);
  border-bottom: 1px solid rgba(216,180,254,0.1);
}
.tab-btn {
  flex: 1;
  padding: 14px;
  background: none;
  box-shadow: none;
  border: none;
  border-radius: 0;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab-btn:hover:not(:disabled) { transform: none; color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); background: rgba(168,85,247,0.08); }

main { position: relative; z-index: 1; padding: 18px 16px 40px; max-width: 520px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: panelIn 0.35s ease; }

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Spiele-Unternavigation ---------- */
.game-switcher {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}
.game-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 76px;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(216,180,254,0.15);
  box-shadow: none;
  color: var(--muted);
  font-size: 1.3rem;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.game-btn span { font-size: 0.7rem; font-weight: 700; color: inherit; }
.game-btn:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(216,180,254,0.4); }
.game-btn.active {
  background: linear-gradient(160deg, var(--accent), var(--accent-dim));
  border-color: var(--accent-bright);
  color: #fff;
  box-shadow: 0 4px 16px rgba(168,85,247,0.5);
}
.game-panel { display: none; }
.game-panel.active { display: block; animation: panelIn 0.35s ease; }

/* ---------- Auth ---------- */
.auth-box {
  position: relative;
  z-index: 1;
  max-width: 340px;
  margin: 32px auto;
  background: linear-gradient(160deg, var(--panel-alt), var(--panel));
  border: 1px solid rgba(216,180,254,0.2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.auth-box h2 { margin-top: 0; font-family: var(--font-display); color: var(--accent-bright); }
.auth-box .hint { font-size: 0.78rem; color: var(--muted); }
.auth-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(216,180,254,0.25);
  margin-bottom: 8px;
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-family: var(--font-body);
}

/* ---------- Bet Panel ---------- */
.bet-panel {
  background: linear-gradient(160deg, var(--panel-alt), var(--panel));
  border: 1px solid rgba(216,180,254,0.18);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bet-field, .side-bet-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.bet-field label, .side-bet-field label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.side-bets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  border: 1px dashed rgba(216,180,254,0.2);
}
.side-bet-info {
  cursor: help;
  color: var(--accent-bright);
  font-size: 0.8rem;
}
input[type="number"], input[type="text"], input[type="password"] {
  width: 100px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(216,180,254,0.25);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
}
.deal-btn { align-self: stretch; }

/* ---------- Table ---------- */
.table {
  background: radial-gradient(ellipse at top, var(--panel-alt), var(--panel) 70%);
  border: 1px solid rgba(216,180,254,0.18);
  border-radius: 18px;
  padding: 20px 16px;
  margin-bottom: 18px;
  text-align: center;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.35), 0 10px 30px rgba(0,0,0,0.35);
}
.dealer-row h3, .hand-box h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent-bright);
  margin: 4px 0;
  letter-spacing: 0.03em;
}
.value-badge {
  display: inline-block;
  background: rgba(0,0,0,0.3);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 700;
}

.cards { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 92px; margin: 8px 0; }
.card {
  width: 56px;
  height: 82px;
  background: linear-gradient(160deg, #fff, #f0eafc);
  color: #1a1130;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-display);
  box-shadow: 0 4px 10px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.5) inset;
  animation: dealIn 0.28s ease;
}
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-14px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card.red { color: #c0295a; }
.card.hidden { background: repeating-linear-gradient(45deg, var(--accent-dim), var(--accent-dim) 6px, #2c1854 6px, #2c1854 12px); box-shadow: 0 4px 10px rgba(0,0,0,0.45); }
.card.flip-reveal { animation: flipReveal 0.45s ease; backface-visibility: hidden; }
@keyframes flipReveal {
  0% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.cards.big .card { width: 84px; height: 116px; font-size: 1.7rem; }

.hands-container { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.hand-box {
  border-radius: 12px;
  padding: 10px;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.hand-box.active-hand { border-color: var(--gold); background: rgba(251,191,36,0.06); }
.hand-box.hand-done { opacity: 0.75; }
.hand-result {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}
.hand-result.win, .hand-result.blackjack { color: var(--success); }
.hand-result.lose { color: var(--danger); }
.hand-result.push { color: var(--muted); }

.side-bet-result {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
  margin: 6px 0;
}
.side-bet-result .win { color: var(--gold); font-weight: 700; }

.pot-line { font-size: 1.1rem; font-weight: 700; }

.actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.message { text-align: center; font-size: 1.05rem; min-height: 1.4em; font-weight: 600; }
.note { text-align: center; font-size: 0.72rem; color: #9c86c4; margin-top: 24px; }

select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(216,180,254,0.25);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 600;
}

/* ---------- Roulette ---------- */
.pending-bets { display: flex; flex-direction: column; gap: 6px; }
.pending-bet {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0,0,0,0.25); border-radius: 8px; padding: 6px 10px; font-size: 0.85rem;
}
.pending-bet button { padding: 2px 8px; font-size: 0.75rem; background: var(--danger); box-shadow: none; }
.wheel-result { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.roulette-wheel {
  position: relative;
  width: 250px; height: 250px;
  margin: 0 auto 10px;
}
.roulette-wheel-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: conic-gradient(
    #991b1b 0deg 16deg, #18181b 16deg 32deg, #991b1b 32deg 48deg, #18181b 48deg 64deg,
    #991b1b 64deg 80deg, #18181b 80deg 96deg, #15803d 96deg 112deg, #991b1b 112deg 128deg,
    #18181b 128deg 144deg, #991b1b 144deg 160deg, #18181b 160deg 176deg, #991b1b 176deg 192deg,
    #18181b 192deg 208deg, #991b1b 208deg 224deg, #18181b 224deg 240deg, #991b1b 240deg 256deg,
    #18181b 256deg 272deg, #991b1b 272deg 288deg, #18181b 288deg 304deg, #991b1b 304deg 320deg,
    #18181b 320deg 336deg, #991b1b 336deg 352deg, #18181b 352deg 360deg
  );
  box-shadow: 0 0 24px rgba(168,85,247,0.4), inset 0 0 20px rgba(0,0,0,0.5);
  border: 3px solid var(--gold);
}
.roulette-wheel.spinning .roulette-wheel-inner { animation: wheelSpin 1.1s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes wheelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(1080deg); }
}
.roulette-pointer {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 14px solid var(--gold);
}
.wheel-number {
  width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: #fff;
  box-shadow: 0 0 24px rgba(168,85,247,0.5), 0 4px 12px rgba(0,0,0,0.5);
}
.wheel-number.red { background: linear-gradient(160deg, #ef4444, #991b1b); }
.wheel-number.black { background: linear-gradient(160deg, #3f3f46, #18181b); }
.wheel-number.green { background: linear-gradient(160deg, #22c55e, #15803d); }
.bet-outcome { font-size: 0.85rem; }
.bet-outcome.win { color: var(--success); }
.bet-outcome.lose { color: var(--danger); }

/* ---------- Plinko ---------- */
.plinko-board {
  position: relative;
  height: 240px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(0,0,0,0.15);
  overflow: hidden;
}
.plinko-peg {
  position: absolute;
  width: 7px; height: 7px;
  margin-left: -3.5px; margin-top: -3.5px;
  border-radius: 50%;
  background: rgba(216,180,254,0.55);
  box-shadow: 0 0 4px rgba(216,180,254,0.5);
}
.plinko-ball {
  position: absolute;
  top: 0; left: 50%;
  width: 15px; height: 15px;
  margin-left: -7.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--gold));
  box-shadow: 0 0 10px rgba(251,191,36,0.8);
}
.plinko-ball.landed { animation: ballLand 0.4s ease; }
@keyframes ballLand {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-10px) scale(1.15); }
  100% { transform: translateY(0) scale(1); }
}
.plinko-buckets {
  display: grid;
  gap: 3px;
}
.plinko-bucket {
  padding: 6px 2px; text-align: center; border-radius: 6px; font-size: 0.68rem; font-weight: 700;
  background: rgba(0,0,0,0.25); color: var(--muted);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.plinko-bucket.landed { background: var(--gold); color: #2b1405; box-shadow: 0 0 14px rgba(251,191,36,0.6); transform: scale(1.08); }

/* ---------- Mines ---------- */
.mines-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.mine-tile {
  aspect-ratio: 1; border-radius: 8px; background: linear-gradient(160deg, var(--accent-dim), #1a1130);
  border: 1px solid rgba(216,180,254,0.25); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer; box-shadow: none; padding: 0;
}
.mine-tile:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 0 12px rgba(168,85,247,0.4); }
.mine-tile.revealed-safe { background: linear-gradient(160deg, #34d399, #059669); animation: tilePop 0.35s ease; }
.mine-tile.revealed-mine { background: linear-gradient(160deg, var(--danger), #9f1239); animation: tileBoom 0.4s ease; }
@keyframes tilePop {
  0% { transform: scale(0.6); opacity: 0.4; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes tileBoom {
  0% { transform: scale(0.8) rotate(0deg); }
  40% { transform: scale(1.2) rotate(-6deg); }
  70% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.mine-tile:disabled { cursor: default; }

/* ---------- Leaderboard & Admin ---------- */
.leaderboard-list, .admin-list { display: flex; flex-direction: column; gap: 8px; }
.leaderboard-row, .admin-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0,0,0,0.25); border-radius: 10px; padding: 8px 14px;
}
.leaderboard-row .rank { color: var(--gold); font-weight: 800; width: 28px; }
.leaderboard-row .name { flex: 1; text-align: left; padding-left: 8px; }
.admin-row input { width: 90px; }
.admin-row button { padding: 6px 12px; font-size: 0.8rem; }

/* ---------- Roulette Board ---------- */
.rl-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.roulette-table { background: #0f4d2e; border: 1px solid rgba(216,180,254,0.18); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.rl-main-grid { display: grid; grid-template-columns: 32px 1fr 40px; gap: 3px; }
.rl-numbers { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; }
.rl-cell {
  position: relative;
  border: none;
  border-radius: 5px;
  background: #18181b;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0;
  min-height: 34px;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rl-cell:hover { filter: brightness(1.25); transform: none; }
.rl-cell.rl-num-red { background: #991b1b; }
.rl-cell.rl-num-black { background: #18181b; }
.rl-zero { background: #15803d; grid-row: 1 / span 3; font-size: 1rem; }
.rl-columns { display: flex; flex-direction: column; gap: 3px; }
.rl-columns .rl-cell { min-height: auto; flex: 1; font-size: 0.65rem; }
.rl-dozens, .rl-outside-bets { display: flex; gap: 3px; margin-top: 3px; }
.rl-dozens .rl-cell, .rl-outside-bets .rl-cell { flex: 1; min-height: 32px; font-size: 0.65rem; }
.rl-outside-bets .rl-red { background: #991b1b; }
.rl-outside-bets .rl-black { background: #18181b; }
.rl-cell .rl-chip-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--gold);
  color: #2b1405;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 4px;
  box-shadow: 0 0 6px rgba(251,191,36,0.7);
  animation: chipDrop 0.25s ease;
}
@keyframes chipDrop {
  from { transform: scale(0.3) translateY(-8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ---------- Glücksrad ---------- */
.fortune-wheel { position: relative; width: 260px; height: 260px; margin: 0 auto 14px; }
.fortune-wheel-inner {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 30px rgba(168,85,247,0.45), inset 0 0 24px rgba(0,0,0,0.5);
  border: 4px solid var(--gold);
  position: relative;
}
.fortune-wheel.spinning .fortune-wheel-inner { animation: wheelSpinLong 3.2s cubic-bezier(0.15, 0.7, 0.2, 1); }
@keyframes wheelSpinLong {
  from { transform: rotate(0deg); }
  to { transform: rotate(var(--final-rotation, 1800deg)); }
}
.fortune-segment-label {
  position: absolute;
  top: 50%; left: 50%;
  transform-origin: 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  min-width: 1.6em;
  text-align: center;
  pointer-events: none;
}

/* ---------- Dice ---------- */
.dice-stats { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.dice-slider { width: 100%; margin: 8px 0; accent-color: var(--gold); }
.dice-track { position: relative; height: 14px; border-radius: 999px; overflow: hidden; background: rgba(0,0,0,0.3); margin-top: 4px; }
.dice-fill { position: absolute; top: 0; bottom: 0; }
.dice-fill.lose { background: linear-gradient(90deg, var(--danger), #9f1239); }
.dice-fill.win { background: linear-gradient(90deg, #34d399, #059669); }
.dice-marker {
  position: absolute; top: -5px; width: 3px; height: 24px; background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
  transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Leben-Tab ---------- */
.life-switcher {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 12px;
  -webkit-overflow-scrolling: touch;
}
.life-btn {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(168,85,247,0.25);
  background: rgba(0,0,0,0.2); color: var(--muted); font-family: var(--font-body);
  font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: all 0.2s ease;
}
.life-btn span { font-size: 0.68rem; }
.life-btn.active { background: linear-gradient(160deg, rgba(251,191,36,0.25), rgba(217,119,6,0.15)); color: var(--gold); border-color: var(--gold); }
.life-panel { display: none; }
.life-panel.active { display: block; animation: panelIn 0.25s ease; }

.housing-ladder { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.housing-tier {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(0,0,0,0.22); border: 1px solid rgba(168,85,247,0.2); opacity: 0.55;
}
.housing-tier.owned { opacity: 1; border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.08); }
.housing-tier.next { opacity: 1; border-color: var(--gold); box-shadow: 0 0 14px rgba(251,191,36,0.25); }
.housing-icon { font-size: 1.6rem; }
.housing-name { flex: 1; font-weight: 700; }
.housing-price { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.housing-tier.owned .housing-price { color: #4ade80; }
.housing-tier button { padding: 6px 14px; }

.life-bars { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 16px; }
.life-bar-row { display: flex; align-items: center; gap: 10px; }
.life-bar-label { width: 90px; font-size: 0.85rem; }
.life-bar { flex: 1; height: 14px; border-radius: 7px; background: rgba(0,0,0,0.3); overflow: hidden; border: 1px solid rgba(255,255,255,0.08); }
.life-bar-fill { height: 100%; border-radius: 7px; transition: width 0.4s ease; }
.life-bar-fill.hunger { background: linear-gradient(90deg, #f97316, #fbbf24); }
.life-bar-fill.thirst { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 12px 8px; border-radius: 12px; background: rgba(0,0,0,0.22); border: 1px solid rgba(168,85,247,0.2);
}
.shop-icon { font-size: 1.6rem; }
.shop-name { font-weight: 700; font-size: 0.85rem; }
.shop-effect { font-size: 0.7rem; color: var(--muted); }
.shop-price { font-size: 0.75rem; color: var(--gold); }
.shop-item button { margin-top: 4px; padding: 4px 12px; font-size: 0.78rem; }

.inventory-list { display: flex; flex-direction: column; gap: 8px; }
.inventory-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,0.18);
}
.inventory-item button { padding: 4px 12px; font-size: 0.75rem; }

.work-area { display: flex; justify-content: center; align-items: center; padding: 20px 0; }
.work-target {
  width: 100%; max-width: 280px; height: 140px; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 800; font-size: 1.1rem; color: #fff; cursor: pointer; user-select: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.work-target.waiting { background: linear-gradient(160deg, #991b1b, #450a0a); }
.work-target.ready { background: linear-gradient(160deg, #22c55e, #15803d); transform: scale(1.04); box-shadow: 0 0 24px rgba(34,197,94,0.5); }
.work-target.too-early { background: linear-gradient(160deg, #7c2d12, #431407); }

.chat-messages {
  height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: 12px; background: rgba(0,0,0,0.22); margin-bottom: 10px;
}
.chat-message { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 0.85rem; }
.chat-user { font-weight: 800; color: var(--gold); }
.chat-time { font-size: 0.65rem; color: var(--muted); }
.chat-text { flex-basis: 100%; color: #f1f5f9; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
  flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(168,85,247,0.3);
  background: rgba(0,0,0,0.25); color: #fff; font-family: var(--font-body);
}

