/* ── Farbpalette (Grüntöne) ──────────────────────────────────
   --bg-deep:    #0d1f0f   Tiefstes Dunkelgrün (Body)
   --bg-card:    #132b16   Karten / Boxen
   --bg-element: #1a3d1e   Elemente (Inputs, Selects)
   --border:     #2d6e35   Rahmen / Trennlinien
   --accent:     #4caf50   Haupt-Akzent (Buttons, Highlights)
   --accent-hi:  #81c784   Hellerer Akzent
   --gold:       #c8e63c   Punkte / Score (Gelbgrün)
   --red:        #e74c3c   Logout / Fehler
   --text:       #e0f0e0   Haupttext
   --text-muted: #7aa87d   Gedämpfter Text
─────────────────────────────────────────────────────────── */

/* ── Grundlayout ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Arial', sans-serif;
    background: url('bg.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    color: #e0f0e0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px 60px;
}

/* ── Container ── */
.container, footer {
  position: relative;
  background: rgba(19, 43, 22, 0.9);
  border-radius: 15px;
  box-shadow: 0 0 30px rgb(218, 185, 157);
  padding: 30px;
  width: fit-content;
  max-width: 560px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

footer { margin-top: 30px;}

.container.wide { width: 100%; max-width: 1000px; }

/* ── Header ── */
.header-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
h1 { font-size: 1.9rem; font-weight: 900; color: #fff; }
.game-code {
    font-size: 1rem; background: #1a3d1e; color: #c8e63c;
    border-radius: 6px; padding: 3px 10px; margin-left: 10px;
    letter-spacing: 2px; vertical-align: middle;
}
.subtitle { color: #7aa87d; margin-bottom: 14px; font-size: 0.95rem; }

/* ── Buttons & Links ── */
.logout-link, button {
    padding: 8px 16px; border-radius: 8px; border: none;
    cursor: pointer; font-weight: 700; font-size: 0.9rem;
    text-decoration: none; transition: opacity 0.2s;
}
.logout-link { background: #e74c3c; color: #fff; }
button       { background: #2d6e35; color: #e0f0e0; }
button:hover, .logout-link:hover { opacity: 0.82; }
button:disabled { background: #1e2e1f; color: #4a6b4d; cursor: not-allowed; opacity: 1; }

/* Solo-Button hervorheben */
.solo-card button {
    background: #4caf50;
    color: #0d1f0f;
    font-size: 1rem;
    padding: 12px 28px;
}
.solo-card button:hover { opacity: 0.88; }

/* ── Login ── */
.login-form {
    display: flex; flex-direction: column;
    gap: 10px; margin: 16px 0; align-items: center;
}
.login-form input {
    font-size: 1rem; padding: 10px 16px; border-radius: 8px;
    border: 2px solid #2d6e35; width: 280px;
    background: #1a3d1e; color: #e0f0e0; outline: none;
    transition: border-color 0.2s;
}
.login-form input:focus { border-color: #4caf50; }
.login-form button { padding: 10px 30px; font-size: 1rem; }
.hint  { color: #7aa87d; font-size: 0.85rem; text-align: center; margin-top: 6px; }
.error { color: #e74c3c; font-weight: bold; margin: 8px 0; text-align: center; }

/* ── Regeln ── */
.rules-box {
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 20px;
    text-align: left;
}
.rules-box h3 { margin-bottom: 10px; color: #e0c060; }
.rules-box ul { padding-left: 20px; }
.rules-box li { margin: 6px 0; color: #ccc; font-size: 0.9rem; }

/* ── Lobby ── */
.lobby-card {
    background: #132b16; border: 1px solid #2d6e35;
    border-radius: 12px; padding: 22px 26px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px; align-items: center;
}
.lobby-card h2 { color: #81c784; }
.lobby-card p  { color: #7aa87d; font-size: 0.95rem; }
.lobby-card label { color: #7aa87d; font-size: 0.9rem; }
.lobby-card select {
    background: #0d1f0f; color: #e0f0e0; border: 1px solid #2d6e35;
    border-radius: 6px; padding: 4px 8px; margin: 0 8px; font-size: 0.9rem;
}
.lobby-card button { margin-top: 14px; padding: 10px 24px; font-size: 1rem; }
.lobby-card input  {
    background: #0d1f0f; color: #c8e63c; border: 2px solid #2d6e35;
    border-radius: 8px; padding: 8px 12px; outline: none;
    transition: border-color 0.2s;
}
.lobby-card input:focus { border-color: #4caf50; }
 
.code-display {
    font-size: 2.5rem; font-weight: 900; color: #c8e63c;
    letter-spacing: 6px; text-align: center;
    background: #1a3d1e; border-radius: 10px;
    padding: 14px; margin: 14px 0;
}
 
.player-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.player-badge {
    background: #1a3d1e; border-radius: 20px;
    padding: 6px 14px; font-size: 0.9rem; color: #e0f0e0;
    transition: background 0.3s;
}
.player-badge.offline { background: #1e1e1e; color: #4a6b4d; }
.offline-tag  { font-size: 0.75rem; color: #e74c3c; margin-left: 4px; vertical-align: middle; }
.offline-col  { color: #2a3d2a !important; background: #0a120b !important; }

/* ── Status ── */
.status-msg {
    text-align: center; font-size: 1.05rem; font-weight: 700;
    padding: 10px 16px; border-radius: 8px; margin-bottom: 14px;
    min-height: 2.4em;
}
.status-my-turn  { background: rgba(76,175,80,0.15); color: #81c784; }
.status-waiting  { background: rgba(200,230,60,0.08); color: #c8e63c; }

/* ── Würfel ── */
.dice-area {
    background: #132b16; border-radius: 12px;
    padding: 18px; margin-bottom: 16px; text-align: center;
}
.dice-row {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 14px; flex-wrap: wrap;
}
.die {
    width: 64px; height: 64px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #2d6e35;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
    user-select: none;
}
.die.held {
    background: #c8e63c; border-color: #8fb02a;
    transform: translateY(-6px);
}
.die.clickable { cursor: pointer; }
.die.clickable:hover { border-color: #4caf50; transform: translateY(-3px); }
.die-face { font-size: 4rem; line-height: 1; }

.dice-actions { display: flex; justify-content: center; gap: 12px; }
#rollBtn {
    background: #4caf50; color: #0d1f0f;
    font-size: 1.05rem; padding: 10px 28px; font-weight: 900;
}
#rollBtn:disabled { background: #1e2e1f; color: #4a6b4d; }

/* ── Punktetabelle ── */
.score-area { overflow-x: auto; }
#scoreTable {
    width: 100%; border-collapse: collapse;
    background: #132b16; border-radius: 10px; overflow: hidden;
    font-size: 1rem;
}
#scoreTable th {
    background: #1a3d1e; color: #81c784;
    padding: 13px 12px; text-align: center;
    white-space: nowrap; font-size: 0.95rem;
}
#scoreTable td {
    padding: 11px 12px; text-align: center;
    border-bottom: 1px solid #1a3d1e; color: #e0f0e0;
    white-space: nowrap; font-size: 1rem;
    min-width: 70px;
}
#scoreTable tr:hover td { background: rgba(76,175,80,0.05); }

.separator-row td  { background: #0f230f !important; font-size: 0.9rem; padding: 9px 12px !important; }
.active-player     { background: #1e4d22 !important; color: #81c784 !important; }
.active-col        { background: rgba(76,175,80,0.07); }
.own-col           { color: #c8e63c; }

.score-filled  { color: #e0f0e0; font-weight: bold; }
.score-zero    { color: #3a5c3d; text-decoration: line-through; }
.score-empty   { color: #2d4d30; }
.score-locked  { color: #1e2e1f !important; cursor: not-allowed !important; }
.score-preview {
    color: #81c784; font-weight: bold; cursor: pointer;
    border-radius: 6px; transition: background 0.15s;
    display: block; padding: 4px 6px;
}
.score-preview:hover { background: rgba(76,175,80,0.18); }
.score-joker {
    color: #c8e63c !important;
    text-shadow: 0 0 8px rgba(200,230,60,0.5);
}
.score-joker:hover { background: rgba(200,230,60,0.12) !important; }
.preview-zero  { color: #e74c3c !important; }
.bonus-reached { color: #81c784 !important; }

/* ── Ergebnis (Multiplayer) ── */
.result-box {
    background: #132b16; border: 2px solid #2d6e35;
    border-radius: 14px; padding: 30px; text-align: center;
    margin-top: 20px;
}
.result-box h2 { color: #81c784; margin-bottom: 20px; font-size: 1.8rem; }
.result-row {
    display: flex; align-items: center; gap: 16px;
    background: #0d1f0f; border-radius: 10px;
    padding: 12px 20px; margin-bottom: 10px;
    font-size: 1.1rem;
}
.result-row.own-result { border: 2px solid #4caf50; }
.medal        { font-size: 1.6rem; min-width: 40px; }
.result-name  { flex: 1; text-align: left; font-weight: 700; }
.result-score { color: #c8e63c; font-weight: 900; font-size: 1.2rem; }
.result-box button {
    margin-top: 20px; background: #2d6e35;
    color: #e0f0e0; padding: 10px 28px; font-size: 1rem;
}

/* ── Ergebnis (Solo) ── */
.solo-result { text-align: center; }
.solo-score-big {
    font-size: 3rem; font-weight: 900;
    color: #c8e63c; margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(200,230,60,0.4);
}
.solo-breakdown {
    background: #0d1f0f; border-radius: 10px;
    padding: 16px 20px; margin-bottom: 20px; text-align: left;
}
.solo-row {
    display: flex; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid #1a3d1e;
    font-size: 1rem; color: #e0f0e0;
}
.solo-row:last-child { border-bottom: none; }
.solo-row.bonus-earned { color: #81c784; font-weight: bold; }
.solo-total {
    font-weight: 900; font-size: 1.1rem;
    color: #c8e63c; border-top: 2px solid #2d6e35;
    margin-top: 4px; padding-top: 10px;
}
.solo-medal {
    font-size: 1.3rem; font-weight: 700;
    color: #81c784; margin-top: 10px;
}

/* ── Highscore ── */
.highscore-box {
    width: 100%; max-width: 560px; margin-top: 28px;
    background: rgba(19, 43, 22, 0.9); border-radius: 10px;
    padding: 20px; border: 1px solid #2d6e35;
}
.highscore-box h2 { margin-bottom: 12px; color: #81c784; }
.highscore-box table { width: 100%; border-collapse: collapse; }
.highscore-box th, .highscore-box td {
    padding: 8px 10px; text-align: center;
    border-bottom: 1px solid #1a3d1e; color: #e0f0e0;
}
.highscore-box th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: #7aa87d; }
tr.rank-1 { background: rgba(200,230,60,0.12); }
tr.rank-2 { background: rgba(192,192,192,0.07); }
tr.rank-3 { background: rgba(150,100,30,0.1); }
tr.own-score td { color: #c8e63c; font-weight: bold; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .die { width: 52px; height: 52px; }
    .die-face { font-size: 1.9rem; }
    #scoreTable { font-size: 0.9rem; }
    #scoreTable td, #scoreTable th { padding: 9px 6px; min-width: 54px; }
    h1 { font-size: 1.5rem; }
    .game-code { font-size: 0.8rem; }
    .solo-score-big { font-size: 2.2rem; }
}
