:root {
            --primary: #00adb5;
            --primary-rgb: 0, 173, 181;
            --primary-hover: #008f96;
            --bg: #1e1e24;
            --card: #252529;
            --input-bg: #18181b;
            --text: #ffffff;
            --text-muted: #8e8e93;
            --border: #2c2c30;
            --confirmed: #00e676;
            --theoretical: #ffca28;
            --table-th-bg: #202024;
            --transition-speed: 0.3s;
            --tier-t5-t8: #8e8e93;
            --tier-t9: #4fc3f7;
            --tier-t10: #4db6ac;
            --tier-t11: #ba68c8;
            --tier-t12: #ffb74d;
            --tier-t13: #ff5f6d;
            --tier-t14: #ffffff;
        }

        body.light-mode {
            --bg: #f4f4f6;
            --card: #ffffff;
            --input-bg: #f0f0f3;
            --text: #1c1c1e;
            --text-muted: #636366;
            --border: #d1d1d6;
            --confirmed: #00aa4f;
            --theoretical: #b28900;
            --table-th-bg: #e5e5ea;
        }

        body {
            font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 20px 20px 40px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            box-sizing: border-box;
            transition: background-color var(--transition-speed), color var(--transition-speed);
        }

        .container {
            background-color: var(--card);
            padding: 30px;
            border-radius: 12px;
            max-width: 800px;
            width: 100%;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            box-sizing: border-box;
            margin-bottom: 20px;
            transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
        }

        body.light-mode .container {
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        }

        .header-actions {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .theme-btn, .lang-btn {
            background-color: #313135;
            color: var(--text-muted);
            border: none;
            padding: 8px 14px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9em;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        body.light-mode .theme-btn, body.light-mode .lang-btn {
            background-color: #e5e5ea;
            color: var(--text-muted);
        }

        .lang-btn.active {
            background-color: var(--primary);
            color: white;
        }

        .theme-btn:hover, .lang-btn:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        h2 {
            text-align: center;
            color: var(--primary);
            margin-top: 0;
            margin-bottom: 5px;
            font-size: 1.9em;
            font-weight: bold;
        }

        .subtitle {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.9em;
            margin-bottom: 25px;
        }

        .row-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        @media (max-width: 480px) {
            .row-grid {
                grid-template-columns: 1fr;
                gap: 0;
            }
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            font-size: 0.9em;
            color: var(--text);
            font-weight: bold;
        }

        label i {
            margin-right: 6px;
            color: var(--primary);
            width: 16px;
            text-align: center;
        }

        .label-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }

        .label-row label {
            margin-bottom: 0;
        }

        .tier-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 0.75em;
            font-weight: bold;
            color: #12121a;
            white-space: nowrap;
        }

        .tier-badge .dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: currentColor;
            display: inline-block;
        }

        .field-error {
            color: #ff6b6b;
            font-size: 0.8em;
            margin-top: 6px;
            display: none;
            align-items: center;
            gap: 6px;
        }

        .field-error.show {
            display: flex;
        }

        input.invalid, select.invalid {
            border-color: #ff6b6b;
        }

        input, select {
            width: 100%;
            padding: 12px;
            border-radius: 6px;
            border: 1px solid var(--border);
            background: var(--input-bg);
            color: var(--text);
            box-sizing: border-box;
            font-size: 0.95em;
            transition: border-color 0.2s, background-color var(--transition-speed);
        }

        input:focus, select:focus {
            outline: none;
            border-color: var(--primary);
        }

        button.calc-btn {
            width: 100%;
            padding: 14px;
            background: var(--primary);
            border: none;
            border-radius: 6px;
            color: white;
            font-weight: bold;
            font-size: 1.1em;
            cursor: pointer;
            margin-top: 10px;
            transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        button.calc-btn:hover {
            background: var(--primary-hover);
            box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
        }

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

        .results {
            margin-top: 25px;
            padding: 20px;
            background: var(--input-bg);
            border-radius: 8px;
            border-left: 4px solid var(--primary);
            text-align: center;
            opacity: 0;
            transform: translateY(-15px);
            max-height: 0;
            padding-top: 0;
            padding-bottom: 0;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .results.show {
            opacity: 1;
            transform: translateY(0);
            max-height: 420px;
            padding-top: 20px;
            padding-bottom: 20px;
        }

        #res-desc {
            margin: 0 0 5px 0;
            font-weight: bold;
        }

        #resDays {
            font-size: 1.8em;
            color: var(--primary);
            font-weight: bold;
            display: block;
        }

        .board-container, .changelog-container {
            margin-top: 25px;
            max-width: 800px;
            width: 100%;
            box-sizing: border-box;
        }

        .board-header, .changelog-header {
            background-color: var(--input-bg);
            border: 1px solid var(--border);
            padding: 12px 15px;
            border-radius: 6px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9em;
            user-select: none;
            transition: background-color var(--transition-speed);
        }

        .board-content, .changelog-content {
            display: none;
            background-color: var(--input-bg);
            border: 1px solid var(--border);
            border-top: none;
            padding: 15px;
            border-bottom-left-radius: 6px;
            border-bottom-right-radius: 6px;
            transition: background-color var(--transition-speed);
        }

        .table-wrapper {
            overflow-x: auto;
            margin-bottom: 20px;
            border: 1px solid var(--border);
            border-radius: 4px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85em;
            min-width: 600px;
        }

        th, td {
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
            text-align: left;
        }

        th {
            color: var(--primary);
            background-color: var(--table-th-bg);
            font-weight: bold;
            transition: background-color var(--transition-speed);
        }

        .val-confirmed {
            color: var(--confirmed);
            font-weight: bold;
        }

        .val-theoretical {
            color: var(--theoretical);
        }

        .val-gen {
            color: #d1c4e9;
        }

        body.light-mode .val-gen {
            color: #673ab7;
        }

        .board-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 14px;
            margin-bottom: 14px;
            padding: 10px 12px;
            background: var(--table-th-bg);
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 0.78em;
        }

        .board-legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .board-legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .board-legend-dot.confirmed { background: var(--confirmed); }
        .board-legend-dot.theoretical { background: var(--theoretical); }
        .board-legend-dot.gen { background: #d1c4e9; }
        body.light-mode .board-legend-dot.gen { background: #673ab7; }

        .board-progress-wrap {
            margin-bottom: 14px;
        }

        .board-progress-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.78em;
            color: var(--text-muted);
            margin-bottom: 5px;
        }

        .board-progress-track {
            width: 100%;
            height: 8px;
            background: var(--border);
            border-radius: 20px;
            overflow: hidden;
            display: flex;
        }

        .board-progress-segment.confirmed { background: var(--confirmed); }
        .board-progress-segment.theoretical { background: var(--theoretical); }
        .board-progress-segment.gen { background: #d1c4e9; }
        body.light-mode .board-progress-segment.gen { background: #673ab7; }

        .board-priority-note {
            margin-top: 10px;
            font-size: 0.78em;
            color: var(--text-muted);
        }

        .board-priority-note strong {
            color: var(--text);
        }

        .board-form {
            border-top: 1px dashed var(--border);
            padding-top: 15px;
            margin-top: 15px;
            text-align: center;
        }

        .submit-board-btn {
            background-color: transparent;
            color: var(--primary);
            border: 1px solid var(--primary);
            padding: 12px 20px;
            border-radius: 6px;
            font-weight: bold;
            cursor: pointer;
            font-size: 0.95em;
            width: 100%;
            transition: all 0.2s;
            box-sizing: border-box;
            display: block;
            text-decoration: none;
        }

        .submit-board-btn:hover {
            background-color: var(--primary);
            color: white;
        }

        .changelog-list {
            list-style: none;
            padding: 0;
            margin: 0;
            font-size: 0.85em;
        }

        .changelog-item {
            margin-bottom: 15px;
            border-bottom: 1px dashed var(--border);
            padding-bottom: 10px;
        }

        .changelog-item:last-child {
            margin-bottom: 0;
            border-bottom: none;
            padding-bottom: 0;
        }

        .changelog-version {
            color: var(--primary);
            font-weight: bold;
            font-family: monospace;
            font-size: 1.1em;
        }

        .changelog-date {
            color: var(--text-muted);
            font-size: 0.9em;
            margin-left: 5px;
        }

        .changelog-changes {
            margin: 5px 0 0 0;
            padding-left: 20px;
            color: var(--text);
            opacity: 0.85;
            line-height: 1.5;
        }

        .footer-notes {
            text-align: center;
            font-size: 0.75em;
            color: var(--text-muted);
            margin-top: 20px;
            line-height: 1.4;
        }

        .version-tag {
            text-align: center;
            font-size: 0.8em;
            color: #5a5a64;
            margin-top: 30px;
            font-family: monospace;
            user-select: none;
            width: 100%;
        }

        .res-warning {
            margin-top: 10px;
            font-size: 0.8em;
            color: var(--theoretical);
            display: none;
            white-space: pre-line;
        }

        .res-warning.show {
            display: block;
        }

        .progress-wrap {
            margin-top: 18px;
        }

        .progress-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.75em;
            color: var(--text-muted);
            margin-bottom: 6px;
        }

        .progress-track {
            width: 100%;
            height: 24px;
            background: var(--border);
            border-radius: 20px;
            overflow: hidden;
            position: relative;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
        }

        .progress-fill {
            height: 100%;
            width: 0%;
            min-width: 4px; /* avoids a clipped rounded cap without implying false progress at 0% */
            background: linear-gradient(90deg, var(--primary), var(--primary-hover), var(--primary));
            background-size: 220% 100%;
            border-radius: 20px;
            position: relative;
            transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
            box-shadow:
                0 0 10px rgba(var(--primary-rgb), 0.55),
                0 0 3px rgba(var(--primary-rgb), 0.9);
            animation: progressShimmer 2.8s linear infinite;
        }

        .progress-fill::after {
            /* diagonal shine sweep for extra shimmer */
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(
                115deg,
                transparent 0%,
                rgba(255, 255, 255, 0.28) 45%,
                transparent 60%
            );
            background-size: 200% 100%;
            animation: progressSweep 2.4s ease-in-out infinite;
        }

        @keyframes progressShimmer {
            0%   { background-position: 0% 50%; }
            100% { background-position: 220% 50%; }
        }

        @keyframes progressSweep {
            0%   { background-position: 120% 0; }
            100% { background-position: -60% 0; }
        }

        .progress-fill.is-complete {
            animation: progressShimmer 2.8s linear infinite, progressPulse 1.1s ease-in-out infinite;
        }

        @keyframes progressPulse {
            0%, 100% {
                box-shadow:
                    0 0 10px rgba(var(--primary-rgb), 0.55),
                    0 0 3px rgba(var(--primary-rgb), 0.9);
            }
            50% {
                box-shadow:
                    0 0 22px rgba(var(--primary-rgb), 0.95),
                    0 0 8px rgba(var(--primary-rgb), 1);
            }
        }

        .progress-percent-inline {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 0.7em;
            font-weight: bold;
            color: #ffffff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
            letter-spacing: 0.3px;
            z-index: 2;
            pointer-events: none;
            white-space: nowrap;
        }

        .results-empty {
            color: var(--text-muted);
            font-size: 0.9em;
            font-style: italic;
        }

        #resDate {
            display: block;
            font-size: 0.85em;
            color: var(--text-muted);
            margin-top: 4px;
            font-weight: normal;
        }

        .val-tooltip {
            position: relative;
            cursor: help;
            border-bottom: 1px dotted currentColor;
        }

        .val-tooltip .tooltip-box {
            visibility: hidden;
            opacity: 0;
            position: absolute;
            bottom: 130%;
            left: 50%;
            transform: translateX(-50%);
            background: var(--table-th-bg);
            color: var(--text);
            border: 1px solid var(--border);
            padding: 8px 10px;
            border-radius: 6px;
            font-size: 0.85em;
            font-weight: normal;
            white-space: normal;
            width: 200px;
            text-align: center;
            z-index: 20;
            box-shadow: 0 4px 14px rgba(0,0,0,0.35);
            transition: opacity 0.15s ease;
            pointer-events: none;
        }

        .val-tooltip:hover .tooltip-box,
        .val-tooltip:focus .tooltip-box {
            visibility: visible;
            opacity: 1;
        }

        .val-tooltip .tooltip-box::after {
            content: "";
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border-width: 6px;
            border-style: solid;
            border-color: var(--border) transparent transparent transparent;
        }
