:root {
    --bg: #0f1218;
    --panel: #171b22;
    --panel-2: #1d2330;
    --border: #2a3140;
    --text: #e8ecf2;
    --muted: #9aa4b2;
    --accent: #5b8cff;
    --accent-soft: #7aa2ff;
    --success: #6dd3a0;
    --danger: #ff7d7d;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    --radius: 16px;
    --radius-sm: 12px;
    --max: 1240px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

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

a:hover {
    color: #ffffff;
}

.page-shell {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topbar-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.topbar-subtitle {
    color: var(--muted);
    font-size: 14px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.game-hero {
    background: linear-gradient(180deg, #171b22 0%, #151922 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 22px;
}

.game-title {
    margin: 0 0 12px;
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: #d7dde8;
    font-size: 13px;
    font-weight: 600;
}

.hours-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(91, 140, 255, 0.14);
    color: #bcd0ff;
    font-weight: 700;
    font-size: 13px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: linear-gradient(180deg, #1a1f28 0%, #171b22 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #3a4356;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.section-card {
    background: linear-gradient(180deg, #171b22 0%, #151922 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 22px;
}

.section-header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.section-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.section-body {
    padding: 18px 20px 20px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.chart-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px;
}

.chart-card h3 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 280px;
}

.journal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.journal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journal-field label {
    font-size: 14px;
    font-weight: 700;
    color: #e8ecf2;
}

.journal-field label span {
    color: var(--muted);
    font-weight: 500;
}

.journal-field input,
.journal-field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0f1218;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.journal-field input:focus,
.journal-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15);
}

.journal-field textarea {
    resize: vertical;
    min-height: 130px;
}

.journal-submit-btn {
    align-self: flex-start;
    padding: 11px 16px;
    border: 1px solid #3a4b69;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.journal-submit-btn:hover {
    transform: translateY(-1px);
    opacity: 0.96;
    box-shadow: 0 10px 24px rgba(91, 140, 255, 0.22);
}

.journal-message {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.journal-message.success {
    background: rgba(109, 211, 160, 0.12);
    border: 1px solid rgba(109, 211, 160, 0.25);
    color: #b8f0d2;
}

.journal-message.error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.24);
    color: #ffc2c2;
}

.journal-entries {
    display: grid;
    gap: 14px;
}

.journal-entry-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 18px;
}

.journal-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.journal-entry-top h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #fff;
    font-weight: 700;
}

.journal-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.journal-entry-content {
    color: #dde5f0;
    font-size: 14px;
    line-height: 1.7;
}

.journal-delete-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    border: 1px solid #374152;
    border-radius: 10px;
    color: #cfd7e4;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.journal-delete-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    transform: translateY(-1px);
}

.journal-empty-state {
    padding: 18px;
    border-radius: 14px;
    border: 1px dashed rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: var(--muted);
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text);
    font-size: 14px;
}

.sessions-table th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.sessions-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.sessions-table tr {
    transition: background 0.18s ease;
}

.sessions-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.sessions-empty {
    color: var(--muted);
    padding: 16px;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 18px;
}

.pagination a,
.pagination strong {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
}

.pagination a {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
}

.pagination a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.pagination strong {
    background: var(--accent);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 700px) {
    .page-shell {
        padding: 20px 14px 36px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-title {
        font-size: 28px;
    }

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

    .journal-entry-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .journal-delete-btn {
        align-self: flex-start;
    }
}

.game-hero-public {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 22px;
    align-items: start;
}

.game-hero-cover-wrap {
    display: flex;
    justify-content: center;
}

.game-cover-large {
    width: 220px;
    height: 300px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
}

.game-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    font-weight: 800;
    color: #fff;
}

.game-hero-content {
    min-width: 0;
}

.game-alt-title {
    margin-top: -2px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 15px;
}

.game-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    margin-top: 16px;
    font-size: 14px;
}

.meta-label {
    color: var(--muted);
    margin-right: 6px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.hero-btn:hover {
    background: rgba(255,255,255,0.10);
}

.copies-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.copy-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px;
}

.copy-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.copy-status {
    color: var(--muted);
    font-size: 13px;
}

.copy-meta {
    display: grid;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}

.copy-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 900px) {
    .game-hero-public {
        grid-template-columns: 1fr;
    }

    .game-cover-large {
        width: 180px;
        height: 245px;
    }

    .game-meta-grid {
        grid-template-columns: 1fr;
    }

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