/* Hex Chess — Dark theme matching adamryba.cz */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --accent: #ff8000;
    --accent-hover: #ff9933;
    --text: #f0f0f0;
    --text-muted: #a0a0a0;
    --border: #1e1e1e;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Layout */
.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.game-container { max-width: 960px; margin: 0 auto; padding: 72px 20px 0; }

/* Header — matches homepage nav */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-logo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.header-logo span { color: var(--text); }

.header-nav {
    display: flex;
    gap: 32px;
}

.header-nav a {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
    transition: color 0.2s;
    margin-left: 0;
}

.header-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
    text-align: center;
    padding: 100px 0 40px;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent), #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 500px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.card:hover { border-color: #2a2a2a; }

.card h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
}

.card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--accent);
}

.card p, .card li {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.7;
}

.card ul {
    list-style: none;
    padding: 0;
}

.card ul li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.card ul li::before {
    content: '♦';
    color: var(--accent);
    position: absolute;
    left: 0;
    font-size: 10px;
    top: 8px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: none;
    font-family: inherit;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: rgba(255, 128, 0, 0.1);
}

.btn-danger {
    background: transparent;
    border: 1px solid #cc3333;
    color: #cc3333;
}

.btn-danger:hover { background: rgba(204, 51, 51, 0.1); }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Form */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: end;
}

.form-row .form-group { flex: 1; margin-bottom: 0; }

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active { background: rgba(0, 200, 0, 0.12); color: #00cc00; }
.status-waiting { background: rgba(255, 128, 0, 0.12); color: var(--accent); }
.status-ended { background: rgba(128, 128, 128, 0.12); color: #888; }

/* Game page layout */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
    margin: 20px 0;
}

.board-panel { text-align: center; }

.board-wrapper {
    display: inline-block;
    position: relative;
}

.hex-board-svg {
    display: block;
    margin: 0 auto;
}

.hex-cell {
    cursor: pointer;
    transition: opacity 0.12s;
}

.hex-cell:hover { opacity: 0.85; }

.piece-text {
    pointer-events: none;
    user-select: none;
}

/* Side panel */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.game-info-label { color: var(--text-muted); }

/* Move list */
.move-list {
    max-height: 360px;
    overflow-y: auto;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    background: var(--bg);
    border-radius: 8px;
    padding: 8px;
}

.move-list::-webkit-scrollbar { width: 6px; }
.move-list::-webkit-scrollbar-track { background: transparent; }
.move-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.move-entry {
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

.move-entry:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }

/* Game controls */
.game-controls {
    display: flex;
    gap: 8px;
}

.game-controls .btn { flex: 1; text-align: center; }

/* Draw notification */
.draw-notification {
    background: rgba(255, 128, 0, 0.08);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.draw-notification p {
    margin-bottom: 12px;
    font-size: 14px;
}

.draw-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    max-width: 400px;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.promotion-pieces {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.promotion-piece {
    font-size: 48px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1;
}

.promotion-piece:hover {
    background: rgba(255, 128, 0, 0.15);
    border-color: var(--accent);
}

/* Toasts */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    transition: opacity 0.3s;
}

.toast-error {
    background: #cc3333;
    color: white;
}

.toast-info {
    background: var(--accent);
    color: var(--bg);
}

/* Rules section */
.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.rule-item h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 4px;
}

.rule-item p {
    font-size: 13px;
    color: var(--text-muted);
}

/* How it works */
.steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: start;
}

.step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.step-text h4 {
    font-size: 15px;
    margin-bottom: 2px;
}

.step-text p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .header-nav a {
        margin-left: 16px;
        font-size: 13px;
    }

    .hero { padding: 40px 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: 0s !important; }
}
