:root {
    --bg-color: #343541;
    --card-bg: #dbe4eb;
    --text-color: #ffffff;
    --card-text-color: #000000;
    --accent-color: #444654;
    --highlight-color: #10a37f;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.center-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.passkey-card {
    width: min(560px, 95%);
    min-height: auto;
    align-items: center;
    gap: 10px;
}

.passkey-form {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

#passkey-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #666;
    color: #000;
    font-size: 1.1rem;
    padding: 8px 6px;
    width: min(320px, 85vw);
}

#passkey-input:focus {
    outline: none;
    border-bottom-color: #111;
}

.passkey-error {
    color: #b00020;
    font-weight: 600;
    margin: 4px 0 0;
}

#start-screen {
    text-align: left;
}

#start-screen h1,
#start-screen h2,
#start-screen h3 {
    text-align: center;
}

#start-screen .instruction-card {
    display: block;
    min-height: auto;
    width: min(860px, 100%);
    margin: 0 auto;
}

#start-screen .instruction-nav {
    margin-top: 24px;
}

.instruction-page {
    display: none;
}

.instruction-page.active {
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
header {
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.week-tracker {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.week-list {
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.week-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background-color: #555;
    font-size: 0.9rem;
}

.week-badge.active {
    background-color: #ccc;
    color: #000;
    font-weight: bold;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.run-info {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 1.2rem;
    height: 40px;
}

/* Main Layout */
.game-dashboard {
    display: flex;
    flex: 1;
    gap: 40px;
}

.dashboard-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row-cards {
    display: flex;
    gap: 20px;
}

.row-cards .card {
    flex: 1;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: bold;
    color: #eee;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    color: var(--card-text-color);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
    /* Increased height for Last value */
}

.card-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.card-value-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.card-hint {
    font-size: 0.8rem;
    color: #666;
    /* Grey */
    font-style: italic;
    text-align: center;
    margin-top: 5px;
}

.last-value {
    font-size: 0.8rem;
    color: #666;
    /* Grey */
    font-style: italic;
    text-align: center;
    margin-top: 5px;
}

.card-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-right: 15px;
}

.icon {
    font-size: 2rem;
}

.card-spacer {
    flex: 1;
    /* Spacer to push content */
}

/* Right Panel */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-left: 1px solid #555;
    padding-left: 20px;
}

.order-section {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}

input[type="number"] {
    background: transparent;
    border: none;
    border-bottom: 2px solid #ccc;
    color: white;
    font-size: 1.5rem;
    padding: 5px;
    width: 100px;
    text-align: center;
}

input[type="number"]:focus {
    outline: none;
    border-bottom-color: white;
}

.btn-primary {
    background-color: #ccc;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #fff;
}

.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #eee;
    opacity: 0.85;
}

.spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-secondary {
    background-color: transparent;
    color: #eee;
    border: 2px solid #888;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
}

.btn-secondary:hover {
    border-color: #ccc;
    color: #fff;
}

/* Only the "No, read again" button in the rules confirmation modal */
#rules-confirm-no {
    background-color: #e4e4e4;
    color: #000;
    border: 2px solid #666;
}

#rules-confirm-no:hover {
    background-color: #f2f2f2;
    border-color: #444;
    color: #000;
}

/* Smaller "Back" button in instructions */
#prev-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dss-section {
    flex: 1;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.05);
}

.dss-title {
    margin: 0 0 0px;
    font-size: 1rem;
    font-weight: 600;
}

.dss-content {
    font-style: italic;
    line-height: 1.4;
    white-space: pre-line;
}

/* Bottom Row */
.balance-section {
    margin-top: 30px;
    margin-bottom: 20px;
}

.balance-cards {
    display: flex;
    gap: 40px;
}

.balance-cards .card {
    flex: 1;
}

/* Utilities */
.hidden {
    display: none;
}

.scroll-box {
    background-color: #eee;
    color: #333;
    padding: 15px;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 20px;
    max-width: 600px;
}

/* Chart Container */
.chart-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.modal.hidden {
    display: none;
}

.modal-card {
    background-color: var(--card-bg);
    color: var(--card-text-color);
    border-radius: 12px;
    padding: 24px 28px;
    width: min(520px, 95vw);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.modal-card h2 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
