.card-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0 12px 0;
}
.card-divider::before,
.card-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--accent);
    margin: 0 12px;
    opacity: 0.25;
}
.divider-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.03em;
}

.index-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header {
    flex: 1 1 auto;
    text-align: left;
    margin: 0;
}

.index-top-controls {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex: 0 0 auto;
    gap: 12px;
}

.index-corner-controls {
    position: fixed;
    top: 18px;
    left: 18px;
    right: 18px;
    z-index: 101;
    pointer-events: none;
}

.index-corner-btn {
    pointer-events: auto;
}

.index-corner-theme {
    position: fixed;
    top: 18px;
    left: 18px;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.index-corner-language-select {
    position: fixed;
    top: 18px;
    right: 18px;
    margin: 0;
    pointer-events: auto;
}

.index-corner-language-select select {
    min-width: 140px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
}
.main-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 8px;
}
.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
    opacity: 0.75;
    margin: 0;
}
:root {
    --primary-color: #FF3D00;
    --bg: #efe4d7;
    --text: #1f1a16;
    --card: #fff2e5;
    --panel: #2a2521;
    --accent: #FF3D00;
    --accent-strong: #FF3D00;
    --accent-soft: #FF3D00;
    --focus-ring: rgba(255, 61, 0, 0.36);
    --mode-easy: #6e9f34;
    --mode-normal: #b66a2d;
    --mode-hard: #a7362a;
    --mode-campaign: #7c3aed;
    --mode-multyplayer: #0e7490;
}

[data-theme="dark"] {
    --primary-color: #FF3D00;
    --bg: #0f0b08;
    --text: #f5ece2;
    --card: #1b130e;
    --panel: #f5ece2;
    --accent: #FF3D00;
    --accent-strong: #FF3D00;
    --accent-soft: #FF3D00;
    --focus-ring: rgba(255, 61, 0, 0.42);
    --mode-easy: #8cc74a;
    --mode-normal: #d88943;
    --mode-hard: #d65848;
    --mode-campaign: #a78bfa;
    --mode-multyplayer: #22d3ee;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: radial-gradient(circle at 12% -8%, rgba(255, 61, 0, 0.2), transparent 42%),
                radial-gradient(circle at 88% 0%, rgba(255, 61, 0, 0.16), transparent 38%),
                var(--bg);
    color: var(--text);
    transition: 0.3s;
}

.container {
    max-width: 1000px;
    margin: auto;
    padding: 40px;

    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--card);
    padding: 25px;
    border-radius: 16px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);

    display: flex;
    flex-direction: column;   /* KLJUČ */
    gap: 10px;
}

.game-page {
    min-height: 100vh;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}

#gameWrapper {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-frame {
    width: 100vmin;
    height: 100vmin;
    max-width: 600px;
    max-height: 90vh;
    border:none;
}
button {
    padding: 10px 20px;
    cursor: pointer;
}

.game-page {
    min-height: 100vh;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
}

.back-link {
    position:absolute;
    top:20px;
    left:20px;
    text-decoration:none;
    color:var(--text);
}

#game-container {
    display:flex;
    justify-content:center;
    align-items:center;
    background: var(--bg);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    text-align: center;
}

th {
    background: var(--card);
}

tr:nth-child(even) {
    background: rgba(0,0,0,0.05);
}
.leaderboard-card {
    background: var(--card);
    padding: 25px;
    border-radius: 16px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.leaderboard-select {
    display: inline-block;
    min-width: 280px;
    max-width: 100%;
    margin: 8px 0 12px;
    padding: 10px 38px 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    background-color: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text) 50%),
        linear-gradient(135deg, var(--text) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.leaderboard-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

[data-theme="dark"] .leaderboard-select {
    border-color: rgba(255, 255, 255, 0.24);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    padding: 12px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.leaderboard-table td {
    padding: 14px;
    font-weight: 600;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.leaderboard-table tr:first-child td {
    font-size: 1.2rem;
    color: var(--accent);
}

.leaderboard-table tr:nth-child(1) td:first-child::before {
    content: "🥇 ";
}

.leaderboard-table tr:nth-child(2) td:first-child::before {
    content: "🥈 ";
}

.leaderboard-table tr:nth-child(3) td:first-child::before {
    content: "🥉 ";
}

.card-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 18px;
}

.game-btn {
    padding: 12px 32px;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(180deg, var(--accent-soft), var(--accent));
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: background 0.2s;
}

.game-btn.easy {
    background: var(--mode-easy);
}

.game-btn.normal {
    background: var(--mode-normal);
}

.game-btn.hard {
    background: var(--mode-hard);
}

.game-btn:hover {
    filter: brightness(1.04);
}

.corner-links {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.corner-link {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.corner-link:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, var(--accent-soft), var(--accent));
    color: #fff;
}

.corner-link svg {
    width: 22px;
    height: 22px;
}

@media (max-width: 640px) {
    .index-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header {
        text-align: center;
    }

    .index-top-controls {
        width: 100%;
        justify-content: stretch;
    }

    .index-corner-theme {
        top: 14px;
        left: 14px;
    }

    .index-corner-language-select {
        top: 14px;
        right: 14px;
    }

    .index-corner-language-select select {
        min-width: 132px;
        width: 100%;
    }

    .corner-links {
        right: 14px;
        bottom: 14px;
    }

    .corner-link {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
}