/* CSS Variables */
:root { 
    --bg-app: #0f172a; --bg-surface: #1e293b; --bg-element: #334155; 
    --primary: #818cf8; --success: #22c55e; --danger: #ef4444; --warning: #f59e0b;
    --text-main: #ffffff; --text-dim: #cbd5e1; --stick: #fde047;
}

/* General Styles */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg-app); font-family: 'Inter', sans-serif; color: var(--text-main); }

/* Container */
.container { display: flex; flex-direction: column; height: 100dvh; max-width: 1000px; margin: 0 auto; background: var(--bg-app); }

/* Join Row */
.join-row { display: flex; gap: 8px; width: 100%; margin-bottom: 10px; }
.join-row input { flex: 1; padding: 12px; border-radius: 12px; border: 2px solid var(--bg-element); background: var(--bg-app); color: #fff; outline: none; }
.join-row button { padding: 0 20px; }

/* Game Header */
.game-header { padding: 15px; text-align: center; border-bottom: 2px solid var(--bg-surface); }
.game-header h1 { margin: 0; font-size: 1.4rem; letter-spacing: 3px; color: var(--primary); font-weight: 800; }

/* Status Info */
#statusInfo { text-align: center; font-size: 1.1rem; margin: 15px 0; min-height: 1.5rem; }

/* Game Layout */
.game-layout { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; padding: 15px; gap: 15px; }
@media (min-width: 900px) { .game-layout { flex-direction: row; } .game-main { flex: 2; } .sidebar { flex: 1; } }

/* --- BOARD --- */
#board-wrapper { position: relative; width: 100%; aspect-ratio: 1/1; max-height: 50dvh; margin: 0 auto; background: var(--bg-surface); border-radius: 30px; border: 3px solid var(--primary); }
.slot { position: absolute; width: 14%; height: 14%; background: var(--bg-app); border: 2px solid var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
#slot-1 { top: 15%; left: 15%; } #slot-2 { top: 15%; left: 71%; } #slot-3 { top: 60%; left: 81%; } #slot-4 { top: 81%; left: 43%; } #slot-5 { top: 60%; left: 5%; }
.slot-num { position: absolute; top: -25px; font-weight: 800; color: var(--primary); font-size: 1.1rem; }

.pot-area { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 28%; height: 28%; background: var(--bg-app); border: 4px dashed var(--primary); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: 0.3s; }
.pot-area.active { border-style: solid; background: var(--primary); box-shadow: 0 0 30px var(--primary); }
.pot-area.active * { color: var(--bg-app); }
.pot-area.rage { animation: rage-pulse 0.8s ease-in-out infinite; box-shadow: 0 0 50px var(--danger), 0 0 80px var(--warning); border-color: var(--danger); }

@keyframes rage-pulse {
  0%, 100% { box-shadow: 0 0 50px var(--danger), 0 0 80px var(--warning); }
  50% { box-shadow: 0 0 70px var(--danger), 0 0 100px var(--warning), inset 0 0 30px var(--danger); }
}

.stick { width: 35%; height: 75%; background: var(--stick); border-radius: 5px; display: none; box-shadow: 0 0 10px var(--stick); }
.slot.has-stick .stick { display: block; animation: pop 0.2s ease-out; }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* --- DICE ANIMATION --- */
.dice-container { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -140%); z-index: 10; }
.dice { width: 65px; height: 65px; background: #fff; border-radius: 12px; display: grid; grid-template: repeat(3, 1fr)/repeat(3, 1fr); padding: 6px; box-shadow: 0 0 20px #fff; }
.dot { background: #000; border-radius: 50%; width: 12px; height: 12px; align-self: center; justify-self: center; }

.rolling { animation: roll 0.6s infinite linear; }
@keyframes roll {
    0% { transform: translate(-50%, -140%) rotate(0deg); }
 100% { transform: translate(-50%, -140%) rotate(360deg); }
}

/* --- PLAYER LIST --- */
.sidebar { display: flex; flex-direction: column; background: var(--bg-surface); border-radius: 20px; padding: 15px; overflow: hidden; }
#playerList { flex-grow: 1; overflow-y: auto; }
.p-card { background: var(--bg-app); padding: 12px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; border: 2px solid transparent; margin-bottom: 8px; transition: 0.3s; }
.active-p { border-color: var(--success); background: #064e3b; }

@media (max-width: 900px) {
  .sidebar { padding: 8px; height: auto; flex-basis: auto; }
  #playerList { overflow-y: hidden !important; height: auto !important; flex-grow: 0 !important; }
  .p-card { margin-bottom: 0 !important; }
}

/* NEU: Ausgrauen */
.finished-p { opacity: 0.35; filter: grayscale(1); }
.spec-p { opacity: 0.5; font-style: italic; }

.chip-badge { background: var(--primary); color: var(--bg-app); padding: 4px 12px; border-radius: 20px; font-weight: 800; }

/* --- BUTTONS --- */
button { border-radius: 12px; border: none; font-weight: 800; cursor: pointer; color: #fff; transition: 0.2s; }
.btn-primary { background: var(--primary); color: var(--bg-app); }
.btn-secondary { background: var(--bg-element); color: var(--text-main); width: 100%; margin-top: 10px; border: 1px solid var(--primary); }
.btn-success { background: var(--success); color: var(--bg-app); width: 100%; margin-top: 5px; }
.btn-roll { background: var(--success); color: var(--bg-app); height: 60px; font-size: 1.4rem; width: 100%; margin-top: 10px; box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4); }
.btn-roll:disabled { background: var(--bg-element); color: var(--text-dim); box-shadow: none; cursor: not-allowed; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); width: 100%; }
.btn-text-danger { color: var(--danger); background: transparent; font-size: 0.8rem; }

/* Host Settings */
.host-settings { background: var(--bg-surface); padding: 15px; border-radius: 15px; border: 1px solid var(--bg-element); margin-bottom: 10px; }
.slider-label { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 5px; }
input[type=range] { width: 100%; accent-color: var(--primary); }
.lobby-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* End Screen */
#endscreen { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.95); z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.loser-box { background: var(--danger); color: #fff; padding: 20px 40px; border-radius: 20px; }