/* ── 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: #e8e8e8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px 60px;
}

/* ── Container ── */
.container, footer {
    width: 100%;
    max-width: 600px;
	position: relative;
	background: rgba(31, 31, 31, 0.8);
	border-radius: 15px;
	border: 1px solid #8b5a2b;
	padding: 30px;
	margin-bottom: 40px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

footer { margin-top: 30px;}

/* ── Header ── */
h1 { font-size: 2rem; font-weight: 900; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.subtitle { color: #b0b0b0; margin-bottom: 14px; font-size: 0.95rem; }

/* ── Score-Boxen ── */
.scores-row { display: flex; gap: 8px; margin-top: 10px;}
.score-box {
    background: #2b2b2b; border: 1px solid #8b5a2b;
    border-radius: 8px; padding: 6px 14px;
    text-align: center; min-width: 80px;
}
.score-box span   { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: #c0c0c0; }
.score-box strong { display: block; font-size: 1.3rem; color: #e6e673; }

/* ── Info-Zeile ── */
.info-row {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 14px; width: 100%;
}
.logout-link {
    padding: 7px 14px; border-radius: 8px;
    background: #b85c1a; color: #fff;
    text-decoration: none; font-weight: 700;
    font-size: 0.88rem; transition: background 0.2s, opacity 0.2s;
}
.logout-link:hover { background: #9b4a14; }

/* ── Modus-Auswahl ── */
.mode-select { text-align: center; }
.mode-select h2 { color: #c0c0c0; margin-bottom: 20px; font-size: 1.4rem; }

.mode-cards {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}
.mode-card {
    background: #2b2b2b; border: 2px solid #8b5a2b;
    border-radius: 14px; padding: 24px 20px;
    flex: 1; min-width: 220px; max-width: 260px;
    display: flex; flex-direction: column;
    gap: 12px; align-items: center; text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}
.mode-card:hover { border-color: #b87c3a; transform: translateY(-3px); }
.mode-icon { font-size: 3rem; }
.mode-card h3 { color: #d6b575; font-size: 1.2rem; }
.mode-card p  { color: #b0b0b0; font-size: 0.9rem; }
.mode-card label { color: #c0c0c0; font-size: 0.85rem; width: 100%; text-align: left; }
.mode-card select, .mode-card input {
    width: 100%; margin-top: 4px;
    background: #1f1f1f; color: #e8e8e8;
    border: 1px solid #8b5a2b; border-radius: 6px;
    padding: 6px 10px; font-size: 0.9rem; outline: none;
    transition: border-color 0.2s;
}
.mode-card input:focus, .mode-card select:focus { border-color: #b87c3a; }
.mode-card button {
    width: 100%; padding: 10px;
    background: #8b5a2b; color: #fff;
    border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 900;
    cursor: pointer; transition: background 0.2s;
    margin-top: 4px;
}
.mode-card button:hover { background: #a56e38; }

/* ── Spielinfo ── */
.game-info {
    display: flex; align-items: center;
    justify-content: space-between;
    background: #2b2b2b; border-radius: 10px;
    padding: 12px 16px; margin-bottom: 14px;
    gap: 10px;
    border: 1px solid #8b5a2b;
}
.player-info {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 8px;
    border: 2px solid transparent; transition: border-color 0.3s;
    flex: 1;
}
.player-info.active-player { border-color: #e6e673; background: rgba(230,230,115,0.1); }
.stone-count {
    font-size: 1.4rem; font-weight: 900; color: #e6e673;
    margin-left: auto;
}
.turn-indicator {
    font-weight: 700; font-size: 0.9rem;
    color: #d6b575; text-align: center; flex: 0;
    white-space: nowrap; width: 200px;
}

/* ── Spielfeld (grün mit Holzrand) ── */
#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    background: #1f6b2f;   /* grüner Spielfeld-Hintergrund */
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5), inset 0 0 0 2px #e0b070, inset 0 0 0 6px #8b5a2b;
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #6b3e1a;  /* zusätzlicher Rand für "Holz"-Optik */
}

.cell {
    background: #2c7a3e;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
    transition: background 0.15s;
    aspect-ratio: 1;
}
.cell:hover { background: #3c8e4e; }

/* ── Steine (Schwarz/Weiß mit subtilen Effekten) ── */
.stone {
    width: 80%; height: 80%;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease;
}
.black-stone {
    background: radial-gradient(circle at 35% 35%, #444, #000);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.6), inset 0 -2px 4px rgba(255,255,255,0.1);
    animation: placeStone 0.2s ease;
}
.white-stone {
    background: radial-gradient(circle at 35% 35%, #f5f5f5, #bbb);
    box-shadow: 2px 3px 8px rgba(0,0,0,0.4), inset 0 -2px 4px rgba(0,0,0,0.1);
    animation: placeStone 0.2s ease;
}

@keyframes placeStone {
    0%   { transform: scale(0.3); opacity: 0.5; }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1);   opacity: 1; }
}

/* Flip-Animation */
.cell.flipping .stone {
    animation: flipStone 0.35s ease;
}
@keyframes flipStone {
    0%   { transform: scaleX(1); }
    50%  { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* ── Gültige Züge (gelber Punkt, gut sichtbar auf grün) ── */
.valid-move { cursor: pointer; }
.move-hint {
    width: 35%; height: 35%;
    border-radius: 50%;
    background: rgba(230, 230, 115, 0.8);
    animation: pulse 1.2s ease infinite;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
@keyframes pulse {
    0%, 100% { transform: scale(1);   opacity: 0.7; }
    50%       { transform: scale(1.2); opacity: 1; }
}

/* ── Aktions-Buttons ── */
.game-actions {
    display: flex; gap: 10px; margin-top: 14px;
    justify-content: center;
}
.game-actions button {
    padding: 9px 20px; border-radius: 8px;
    border: none; cursor: pointer;
    font-weight: 700; font-size: 0.9rem;
    transition: background 0.2s;
    background: #8b5a2b; color: #fff;
}
.game-actions button:hover { background: #a56e38; }

.game-message {
    text-align: center; margin-top: 10px;
    color: #e6e673; font-size: 0.95rem;
    min-height: 1.4em;
}

/* ── Ergebnis ── */
.result-box {
    background: #2b2b2b; border: 2px solid #8b5a2b;
    border-radius: 14px; padding: 32px;
    text-align: center; margin-top: 20px;
}
.result-box h2 { font-size: 2rem; margin-bottom: 16px; }
.result-win  { color: #e6e673; }
.result-lose { color: #e07c3c; }
.result-draw { color: #c0c0c0; }

.final-score {
    display: flex; justify-content: center;
    gap: 30px; font-size: 1.2rem;
    margin-bottom: 20px; color: #e8e8e8;
}
.final-score strong { color: #e6e673; font-size: 1.6rem; }

.result-box button {
    margin: 6px; padding: 10px 24px;
    border-radius: 8px; border: none;
    font-weight: 700; font-size: 0.95rem;
    cursor: pointer; transition: background 0.2s;
}
#playAgainBtn { background: #8b5a2b; color: #fff; }
#menuBtn      { background: #5a3a1a; color: #fff; }
#playAgainBtn:hover, #menuBtn:hover { background: #a56e38; }

/* ── 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 #8b5a2b;
    width: 280px; background: #2b2b2b; color: #e8e8e8;
    outline: none; transition: border-color 0.2s;
}
.login-form input:focus { border-color: #b87c3a; }
.login-form button {
    background: #8b5a2b; color: #fff;
    border: none; border-radius: 8px;
    padding: 10px 30px; font-size: 1rem;
    font-weight: 700; cursor: pointer;
    transition: background 0.2s;
}
.login-form button:hover { background: #a56e38; }
.hint  { color: #b0b0b0; font-size: 0.85rem; text-align: center; margin-top: 6px; }
.error { color: #e07c3c; font-weight: bold; margin: 8px 0; text-align: center; }

/* ── Regelbox ── */
.rules-box {
    background: #2b2b2b; border-radius: 10px;
    padding: 16px 20px; margin-top: 18px;
    border: 1px solid #8b5a2b; text-align: left;
}
.rules-box h3 { color: #d6b575; margin-bottom: 10px; }
.rules-box ul { padding-left: 18px; }
.rules-box li { margin: 6px 0; color: #c0c0c0; font-size: 0.9rem; line-height: 1.4; }

/* ── Highscore ── */
.highscore-box {
    width: 100%; max-width: 600px; margin-top: 28px;
	background: rgba(31, 31, 31, 0.8); border-radius: 10px;
    padding: 20px; border: 1px solid #8b5a2b;
}
.highscore-box h2 { margin-bottom: 12px; color: #d6b575; }
.highscore-box table { width: 100%; border-collapse: collapse; }
.highscore-box th, .highscore-box td {
    padding: 8px 10px; text-align: center;
    border-bottom: 1px solid #4a3a2a; color: #e0e0e0;
}
.highscore-box th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; color: #b0b0b0; }
tr.rank-1 { background: rgba(230,230,115,0.12); }
tr.rank-2 { background: rgba(192,192,192,0.07); }
tr.rank-3 { background: rgba(150,100,30,0.10); }
tr.own-score td { color: #e6e673; font-weight: bold; }

/* ── Responsive ── */
@media (max-width: 480px) {
    h1 { font-size: 1.6rem; }
    .mode-cards { flex-direction: column; align-items: center; }
    .mode-card  { width: 100%; max-width: 100%; }
    #board { gap: 2px; padding: 6px; }
}