* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: #1a1a2e; color: #eee; min-height: 100vh; }
.app { max-width: 100%; }
.hidden { display: none !important; }

.screen { padding: 1.5rem; max-width: 520px; margin: 0 auto; }
.screen h1 { color: #e94560; margin-top: 0; }

.login-card { background: #16213e; padding: 1.5rem; border-radius: 12px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; color: #aaa; }
.form-group input { width: 100%; padding: 0.6rem 0.75rem; font-size: 1rem; border-radius: 8px; border: 1px solid #333; background: #0f3460; color: #fff; }
.login-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
.error { color: #e94560; margin-top: 0.5rem; font-size: 0.95rem; text-align: center; }

.player-list { list-style: none; padding: 0; }
.player-list li { background: #0f3460; padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; border: 1px solid #333; }

.layout-game { max-width: 100%; padding: 1rem; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 720px) {
  .layout-game { grid-template-columns: minmax(350px, max-content) 1fr; }
}

.sidebar { background: #16213e; padding: 1rem; border-radius: 12px; height: fit-content; min-width: 320px; }
.sidebar h2 { margin-top: 0; color: #e94560; font-size: 1.25rem; }

.highscore-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.95rem; }
.highscore-table th, .highscore-table td { padding: 0.5rem; text-align: left; }
.highscore-table th { color: #aaa; border-bottom: 2px solid #0f3460; font-weight: 600; }
.highscore-table td { border-bottom: 1px solid #333; }

.spieltisch { background: #16213e; padding: 1.25rem; border-radius: 12px; display: flex; flex-direction: column; align-items: center; }
.phase-bar { background: #e94560; color: #fff; padding: 0.5rem 1rem; border-radius: 8px; font-weight: bold; margin-bottom: 1.5rem; width: 100%; text-align: center; }
.game-block { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; }
.turn-info { font-size: 1.2rem; margin: 0 0 1rem 0; color: #4ecca3; font-weight: bold; }

.dice-container { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 1.25rem 0; }
.dice { width: 64px; height: 64px; border-radius: 12px; border: 3px solid #333; background: linear-gradient(145deg, #2a2a4a, #1a1a2e); position: relative; padding: 0; cursor: pointer; transition: transform 0.1s, border-color 0.2s; box-shadow: 2px 2px 10px rgba(0,0,0,0.3); }
.dice:active { transform: scale(0.95); }
.dice.locked { border-color: #4ecca3; background: linear-gradient(145deg, #1e3a2f, #0f2a1f); transform: translateY(-5px); box-shadow: 0 5px 15px rgba(78, 204, 163, 0.2); }

.pip { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #eee; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); transition: opacity 0.2s; opacity: 0; }

.dice .pip:nth-child(1) { top: 15%; left: 15%; }
.dice .pip:nth-child(2) { top: 15%; left: 50%; transform: translateX(-50%); }
.dice .pip:nth-child(3) { top: 15%; left: 85%; transform: translateX(-100%); }
.dice .pip:nth-child(4) { top: 50%; left: 15%; transform: translateY(-50%); }
.dice .pip:nth-child(5) { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.dice .pip:nth-child(6) { top: 50%; left: 85%; transform: translate(-100%, -50%); }
.dice .pip:nth-child(7) { top: 85%; left: 15%; transform: translateY(-100%); }
.dice .pip:nth-child(8) { top: 85%; left: 50%; transform: translate(-50%, -100%); }
.dice .pip:nth-child(9) { top: 85%; left: 85%; transform: translate(-100%, -100%); }

.dice.face-1 .pip:nth-child(5) { opacity: 1; }
.dice.face-2 .pip:nth-child(1), .dice.face-2 .pip:nth-child(9) { opacity: 1; }
.dice.face-3 .pip:nth-child(1), .dice.face-3 .pip:nth-child(5), .dice.face-3 .pip:nth-child(9) { opacity: 1; }
.dice.face-4 .pip:nth-child(1), .dice.face-4 .pip:nth-child(3), .dice.face-4 .pip:nth-child(7), .dice.face-4 .pip:nth-child(9) { opacity: 1; }
.dice.face-5 .pip:nth-child(1), .dice.face-5 .pip:nth-child(3), .dice.face-5 .pip:nth-child(5), .dice.face-5 .pip:nth-child(7), .dice.face-5 .pip:nth-child(9) { opacity: 1; }
.dice.face-6 .pip:nth-child(1), .dice.face-6 .pip:nth-child(3), .dice.face-6 .pip:nth-child(4), .dice.face-6 .pip:nth-child(6), .dice.face-6 .pip:nth-child(7), .dice.face-6 .pip:nth-child(9) { opacity: 1; }

.dice.empty { border-style: dashed; }

.rank-display { font-size: 1.25rem; font-weight: bold; color: #fca311; margin: 1rem 0; min-height: 1.5rem; }
.game-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; width: 100%; }

.btn { padding: 0.8rem 1.25rem; font-size: 1rem; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; flex: 1; transition: all 0.2s; white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn:active:not(:disabled) { transform: scale(0.95); }
.btn-primary { background: #e94560; color: #fff; }
.btn-secondary { background: #0f3460; color: #fff; }
.btn-warning { background: #fca311; color: #1a1a2e; }