﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0f172a;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Option Selector Modal (Pregame) */
.option-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem 1rem 1rem;
    overflow: visible;
    box-sizing: border-box;
}

.option-selector-overlay.hidden {
    display: none;
}

.option-selector {
    text-align: center;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    border: 2px solid #334155;
    max-width: 650px;
    width: 90%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-sizing: border-box;
    box-shadow: none;
    backdrop-filter: blur(10px);
    margin: auto;
}

.skills-checks-link-container {
    margin-top: 1.5rem;
    text-align: center;
    width: 100%;
}

.skills-checks-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.skills-checks-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.modal-logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.modal-logo h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
}

.modal-logo .boxtext {
    color: #ffffff;
    font-weight: 300;
}

.ski-run-title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    margin-top: 1.5rem;
    font-family: 'Roboto', sans-serif;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.form-section-title {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.ski-run-selection-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.ski-run-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.ski-run-label {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
}

.ski-run-select-btn {
    flex: 1;
    padding: 0.875rem 1.25rem;
    background-color: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    color: #111827;
    font-size: 0.9375rem;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

.ski-run-select-btn:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}

.ski-run-select-btn::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #111827;
}

.ski-run-select-btn.selected {
    background-color: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(51, 65, 85, 0.5);
    color: #ffffff;
}

.ski-run-select-btn.selected:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(30, 41, 59, 0.8);
}

.ski-run-select-btn.selected::after {
    border-top-color: #ffffff;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
}

.action-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
}

.action-button {
    width: auto;
    min-width: 200px;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-button img,
.action-button svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.action-button:active {
    transform: translateY(0);
}

.action-button.project {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.action-button.print {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}


.mobile-view-message {
    display: none;
}

/* Print Preview Container */
.print-preview-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f3f4f6;
    z-index: 2005;
    overflow-y: auto;
}

.print-preview-container.active {
    display: flex;
    flex-direction: column;
}

.print-preview-nav {
    display: none;
}

.print-preview-nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.print-preview-back-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: #374151;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Roboto', sans-serif;
}

.print-preview-back-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.print-preview-nav-right {
    display: flex;
    gap: 1rem;
}

.print-preview-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    color: #ffffff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
}

.print-preview-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.print-preview-content {
    flex: 1;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f4f6;
}

.print-layout {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 0.4cm 1cm 0.35cm 1cm;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 297mm;
    height: 210mm;
    aspect-ratio: 297 / 210;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
    page-break-inside: avoid;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25cm;
    flex-shrink: 0;
}

.print-logo {
    display: flex;
    align-items: center;
    gap: 0.3cm;
}

.print-logo img {
    height: 32px;
    width: auto;
    filter: brightness(0);
}

.print-logo-text {
    font-size: 1.8rem;
    font-weight: 600;
    color: #000000;
    font-family: 'Roboto', sans-serif;
}

.print-logo-text .boxtext {
    font-weight: 300;
}

.print-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #000000;
    letter-spacing: 0.5px;
    margin-left: 0.3cm;
}

.print-name-field {
    display: flex;
    align-items: center;
    gap: 0.3cm;
}

.print-name-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
}

.print-name-line {
    border-bottom: 1px solid #000000;
    width: 280px;
    height: 1rem;
}

.print-runs-container {
    display: flex;
    justify-content: space-between;
    gap: 0.5cm;
    margin-bottom: 0.2cm;
    flex: 1 1 auto;
    min-height: 0;
}

.print-run-column {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    max-width: 32%;
}

.print-run-label {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25cm;
    text-align: center;
    color: #000000;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.print-start-number {
    border: 1.5px solid #000000;
    border-radius: 0.15cm;
    padding: 0.2cm 0.15cm;
    text-align: center;
    margin-bottom: 0.25cm;
    background: white;
    flex-shrink: 0;
}

.print-start-label {
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 0.1cm;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.print-start-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000000;
    line-height: 1.2;
}

.print-operations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(10, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    border: 1.5px solid #000000;
    border-radius: 0.25cm;
    background: transparent;
}

.print-operation-text {
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    padding: 0.15cm 0.2cm;
    font-size: 1.6rem;
    font-weight: 400;
    text-align: center;
    color: #000000;
    background: transparent;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-height: 100%;
}

.print-operation-text:nth-last-child(-n+2) {
    border-bottom: none;
}

.print-operation-box {
    border-bottom: 1px solid #000000;
    border-right: none;
    padding: 0.15cm;
    background: transparent;
    margin: 0;
}

.print-operation-box:nth-last-child(-n+2) {
    border-bottom: none;
}

.print-final-answer {
    margin-top: 0.25cm;
    text-align: center;
    flex-shrink: 0;
    border: 1.5px solid #000000;
    border-radius: 0.15cm;
    padding: 0.2cm 0.15cm;
    background: white;
}

.print-final-label {
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 0.1cm;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.print-final-box {
    min-height: 32px;
    max-height: 32px;
    background: transparent;
}

.print-footer {
    text-align: center;
    margin-top: 0.2cm;
    padding-top: 0.08cm;
    font-size: 0.8rem;
    color: #000000;
    flex-shrink: 0;
    font-weight: 500;
}

/* Print Styles - A4 Landscape */
@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    * {
        box-sizing: border-box !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    /* Hide everything except print preview */
    .option-selector-overlay,
    .game-container,
    .game-header,
    .game-header-actions,
    .timer-container,
    .rules-popup,
    .selection-modal,
    .code-modal,
    .save-code-modal,
    .skills-checks-modal,
    .mobile-view-message,
    .print-preview-nav,
    button,
    .action-button,
    .answer-btn,
    .new-question-top-btn,
    .save-btn,
    .toggle-timer-btn,
    .game-print-btn,
    a {
        display: none !important;
    }

    /* Show print preview container */
    .print-preview-container {
        position: static !important;
        background: white !important;
        display: flex !important;
    }

    .print-preview-content {
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .print-layout {
        box-shadow: none !important;
        padding: 0.4cm 1cm 0.35cm 1cm !important;
        margin: 0 !important;
        width: 100% !important;
        max-height: 210mm !important;
        height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
    }

    .print-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        margin-bottom: 0.35cm !important;
        flex-shrink: 0 !important;
    }

    .print-logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.3cm !important;
    }

    .print-logo img {
        height: 32px !important;
        filter: brightness(0) !important;
    }

    .print-logo-text {
        font-size: 1.8rem !important;
        font-weight: 600 !important;
        color: #000000 !important;
        font-family: 'Roboto', sans-serif !important;
    }

    .print-logo-text .boxtext {
        font-weight: 300 !important;
    }

    .print-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
        letter-spacing: 0.5px !important;
        margin-left: 0.3cm !important;
    }

    .print-name-field {
        display: flex !important;
        align-items: center !important;
        gap: 0.3cm !important;
    }

    .print-name-label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: #000000 !important;
    }

    .print-name-line {
        border-bottom: 1px solid #000000 !important;
        width: 280px !important;
        height: 1rem !important;
    }

    .print-runs-container {
        display: flex !important;
        justify-content: space-between !important;
        gap: 0.6cm !important;
        margin-bottom: 0.25cm !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .print-run-column {
        flex: 1 1 0 !important;
        display: flex !important;
        flex-direction: column !important;
        max-width: 32% !important;
        overflow: hidden !important;
    }

    .print-run-label {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
        margin-bottom: 0.25cm !important;
        flex-shrink: 0 !important;
        letter-spacing: 1px !important;
    }

    .print-start-number {
        border: 1.5px solid #000000 !important;
        border-radius: 0.15cm !important;
        padding: 0.2cm 0.15cm !important;
        margin-bottom: 0.25cm !important;
        background: white !important;
        flex-shrink: 0 !important;
    }

    .print-start-label {
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        color: #000000 !important;
        margin-bottom: 0.1cm !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .print-start-value {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
        line-height: 1.2 !important;
    }

    .print-run-column {
        border-radius: 0.3cm !important;
    }
    .print-start-number {
        border: 1.5px solid #000000 !important;
        border-radius: 0.15cm !important;
    }
    .print-operations {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: repeat(10, 1fr) !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        border: 1.5px solid #000000 !important;
        border-radius: 0.25cm !important;
        background: white !important;
    }

    .print-run-column {
        border-radius: 0.3cm !important;
    }
    .print-start-number {
        border: 1.5px solid #000000 !important;
        border-radius: 0.15cm !important;
    }
    .print-operations {
        border: 1.5px solid #000000 !important;
        border-radius: 0.25cm !important;
    }
    .print-operation-text {
        border-right: 1px solid #000000 !important;
        border-bottom: 1px solid #000000 !important;
        padding: 0.1cm 0.15cm !important;
        font-size: 1.5rem !important;
        font-weight: 400 !important;
        color: #000000 !important;
        background: white !important;
        line-height: 1.2 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        max-height: 100% !important;
    }

    .print-operation-text:nth-last-child(-n+2) {
        border-bottom: none !important;
    }

    .print-operation-box {
        border-bottom: 1px solid #000000 !important;
        border-right: none !important;
        padding: 0.1cm !important;
        background: transparent !important;
        margin: 0 !important;
    }

    .print-operation-box:nth-last-child(-n+2) {
        border-bottom: none !important;
    }

    .print-final-answer {
        margin-top: 0.18cm !important;
        flex-shrink: 0 !important;
        border: 1.5px solid #000000 !important;
        border-radius: 0.15cm !important;
        padding: 0.15cm 0.12cm !important;
        background: white !important;
    }

    .print-final-label {
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        color: #000000 !important;
        margin-bottom: 0.1cm !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .print-final-box {
        min-height: 32px !important;
        max-height: 32px !important;
        background: transparent !important;
    }

    .print-footer {
        font-size: 0.75rem !important;
        font-weight: 500 !important;
        color: #000000 !important;
        margin-top: 0.15cm !important;
        padding-top: 0.05cm !important;
        flex-shrink: 0 !important;
        display: block !important;
    }

    /* Remove all effects */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    /* Prevent page breaks */
    .game-container,
    .ski-runs-container,
    .ski-run-column {
        page-break-inside: avoid !important;
    }
}

@media (max-width: 800px) {
    .mobile-view-message {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 2rem;
        background: #0f172a;
        color: #ffffff;
        font-family: 'Roboto', sans-serif;
        font-size: 1.25rem;
        font-weight: 500;
        text-align: center;
    }

    .option-selector-overlay {
        display: none !important;
    }

    .game-container {
        display: none !important;
    }
}

/* Rules Popup */
.rules-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2001;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.rules-popup.active {
    display: flex;
}

.rules-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #334155;
    position: relative;
}

.rules-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.rules-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    text-align: center;
    margin: 0;
}

.rules-close-btn {
    position: absolute;
    right: 0;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    line-height: 1;
}

.rules-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.rules-text {
    color: #e2e8f0;
    font-size: 1.5rem;
    line-height: 1.8;
    font-family: 'Roboto', sans-serif;
    text-align: center;
}

.rules-text ol {
    font-size: 1.5rem;
}

.rules-text li {
    margin-bottom: 1rem;
}

.rules-text p {
    margin-bottom: 1rem;
}

.rules-text p:last-child {
    margin-bottom: 0;
}

.how-to-use-link {
    display: block;
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    margin-top: 0.5rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.how-to-use-link:hover {
    color: #6b7280;
    text-decoration: underline;
}

.modal-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.modal-link {
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

.modal-link:hover {
    color: #6b7280;
    text-decoration: underline;
}

/* Code Modal */
.code-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2003;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.code-modal.active {
    display: flex;
}

.code-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    max-width: 500px;
    width: 90%;
    border: 2px solid #334155;
    position: relative;
}

.code-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.code-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.code-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    line-height: 1;
}

.code-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.code-input-group {
    margin-bottom: 1.5rem;
}

.code-input-label {
    display: block;
    color: #e2e8f0;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.code-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
    font-family: 'Roboto', sans-serif;
}

.code-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
}

.code-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
}

.code-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Save Code Modal */
.save-code-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2004;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.save-code-modal.active {
    display: flex;
}

.save-code-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    padding: 2rem 2.5rem;
    max-width: 500px;
    width: 90%;
    border: 2px solid #334155;
    position: relative;
}

.save-code-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.save-code-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.save-code-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    line-height: 1;
}

.save-code-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.code-display-group {
    margin-bottom: 1.5rem;
}

.code-display-label {
    display: block;
    color: #e2e8f0;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.code-display {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.7);
    border: 2px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Roboto', monospace;
    text-align: center;
    letter-spacing: 0.1em;
}

.code-copy-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 0.5rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
}

.code-copy-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Skills Checks Modal */
.skills-checks-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2005;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.skills-checks-modal.active {
    display: flex;
}

.skills-checks-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    padding: 1.5rem 1.5rem;
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    border: 2px solid #334155;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.skills-checks-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.skills-checks-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.skills-checks-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    line-height: 1;
}

.skills-checks-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.skills-checks-links-container {
    overflow: visible;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
}

.skills-check-link {
    display: block;
    padding: 0.75rem 1rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.skills-check-link:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

/* Responsive styles for skills checks modal */
@media (max-width: 768px) {
    .skills-checks-modal-content {
        width: 98%;
        padding: 0.75rem;
        max-height: 95vh;
    }
    
    .skills-checks-modal-title {
        font-size: 1.25rem;
    }
    
    .skills-checks-links-container {
        overflow-y: auto;
    }
    
    .skills-checks-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0.4rem !important;
        padding: 0.4rem !important;
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .skills-check-link {
        font-size: 0.9rem !important;
        padding: 0.25rem !important;
        aspect-ratio: 1 !important;
        min-width: 0 !important;
        min-height: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    .skills-checks-modal-content {
        width: 100%;
        padding: 0.5rem;
        border-radius: 1rem;
    }
    
    .skills-checks-modal-header {
        margin-bottom: 0.5rem;
    }
    
    .skills-checks-modal-title {
        font-size: 1rem;
    }
    
    .skills-checks-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 0.3rem !important;
        padding: 0.3rem !important;
    }
    
    .skills-check-link {
        font-size: 0.85rem !important;
        padding: 0.2rem !important;
        aspect-ratio: 1 !important;
    }
}

.code-copy-btn.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Selection Modal */
.selection-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2002;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.selection-modal.active {
    display: flex;
}

.selection-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 1.5rem;
    padding: 0;
    max-width: 900px;
    width: 90%;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border: 2px solid #334155;
    position: relative;
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #334155;
    flex-shrink: 0;
}

.selection-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.selection-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    line-height: 1;
}

.selection-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.selection-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 2rem 0 2rem;
    border-bottom: 2px solid #334155;
    overflow-x: auto;
    flex-shrink: 0;
}

.selection-tab {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #94a3b8;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Roboto', sans-serif;
}

.selection-tab:hover {
    color: #cbd5e1;
}

.selection-tab.active {
    color: #ffffff;
    border-bottom-color: #3b82f6;
}

.selection-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* Custom Scrollbar Styling */
.selection-body::-webkit-scrollbar {
    width: 10px;
}

.selection-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 5px;
}

.selection-body::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.8);
    border-radius: 5px;
    border: 2px solid rgba(15, 23, 42, 0.5);
}

.selection-body::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.9);
}

.selection-tabs::-webkit-scrollbar {
    height: 6px;
}

.selection-tabs::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 3px;
}

.selection-tabs::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.8);
    border-radius: 3px;
}

.selection-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.9);
}

.selection-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selection-item {
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 2px solid rgba(51, 65, 85, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #e2e8f0;
    font-size: 0.9375rem;
    text-align: left;
}

.selection-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(59, 130, 246, 0.5);
    color: #ffffff;
}

.selection-item.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #ffffff;
}

.selection-tab-panel {
    display: none;
}

.selection-tab-panel.active {
    display: block;
}

/* Game Container */
.game-container {
    margin: 0 auto;
    position: relative;
    height: 100vh;
    max-height: 100vh;
    display: none;
    flex-direction: column;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
    max-width: none;
}

.game-container.active {
    display: flex;
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
    padding: 0;
}

.game-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo-section:hover {
    opacity: 0.8;
}

.logo-section img {
    height: 32px;
    width: auto;
    display: block;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.logo-section span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.logo-section .boxtext {
    font-weight: 300;
}

.info-icon-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    width: 44px;
    height: 44px;
    line-height: 1;
}

.info-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.change-settings-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 44px;
    height: 44px;
}

.change-settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.change-settings-btn img {
    width: 22px;
    height: 22px;
}

.toggle-timer-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    width: 44px;
    height: 44px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-timer-btn svg,
.toggle-timer-btn img {
    width: 24px;
    height: 24px;
}

.toggle-timer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.toggle-timer-btn.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #93c5fd;
}

.save-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    height: 44px;
    width: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn svg,
.save-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.save-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.game-print-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    height: 44px;
    width: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-print-btn svg {
    width: 40px;
    height: 40px;
    stroke: #ffffff;
}

.game-print-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.new-question-top-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000000;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Roboto', sans-serif;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-question-top-btn:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.timer-container {
    display: none;
    align-items: center;
    gap: 0.5rem;
    height: 44px;
    flex-shrink: 0;
}

.timer-container.active {
    display: flex;
}

.timer-display-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
    height: 100%;
}

.timer-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 0.75rem;
    background: transparent;
    border: none;
    border-radius: 0.5rem;
    height: 100%;
}

.timer-display:hover {
    background: rgba(255, 255, 255, 0.1);
}

.timer-play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: rgba(34, 197, 94, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.timer-play-icon.paused {
    background: rgba(34, 197, 94, 0.95);
}

.timer-play-icon.playing {
    background: rgba(239, 68, 68, 0.95);
}

.timer-display:hover .timer-play-icon {
    opacity: 1;
}

.timer-play-icon svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

.timer-reset-link {
    color: #9ca3af;
    font-size: 0.75rem;
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    height: 100%;
}

.timer-container:hover .timer-reset-link {
    opacity: 1;
    pointer-events: auto;
}

.timer-reset-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.timer-reset-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.timer-display.flash-red {
    animation: flashRed 0.5s infinite;
}

@keyframes flashRed {
    0%, 100% {
        color: #ef4444;
    }
    50% {
        color: #ffffff;
    }
}

.timer-adjust-btn {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    flex-shrink: 0;
}

.timer-container:hover .timer-adjust-btn {
    opacity: 1;
    pointer-events: auto;
}

.timer-adjust-btn:hover {
    background: rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
}

/* Game Area */
.game-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    overflow: hidden;
}

/* Ski Runs Container */
.ski-runs-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
    padding-left: calc((0.35 / (0.8 + 0.35)) * 25%);
}

@media (max-width: 1200px) {
    .ski-runs-container {
        padding-left: calc((0.35 / (0.8 + 0.35)) * 20%);
    }
}

@media (max-width: 900px) {
    .ski-runs-container {
        padding-left: calc((0.35 / (0.8 + 0.35)) * 15%);
    }
    
    .operation-text {
        font-size: 1.4rem;
        padding: 0.4rem 0.6rem;
    }
    
    .operation-answer {
        font-size: 1rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 768px) {
    .operation-text {
        font-size: 1.2rem;
        padding: 0.35rem 0.5rem;
    }
    
    .operation-answer {
        font-size: 0.9rem;
        padding: 0.35rem 0.5rem;
    }
    
    .operation-card {
        gap: 0.35rem;
    }
}

@media (max-width: 600px) {
    .operation-text {
        font-size: 1rem;
        padding: 0.3rem 0.4rem;
    }
    
    .operation-answer {
        font-size: 0.85rem;
        padding: 0.3rem 0.4rem;
    }
    
    .operation-card {
        gap: 0.3rem;
    }
}

.ski-run-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    min-height: 0;
}

.ski-run-header {
    display: grid;
    grid-template-columns: 0.8fr 0.35fr;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ski-run-column-title {
    display: none;
}

.start-number-display {
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.start-number-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.start-number-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.operations-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-height: 0;
    overflow: visible;
    padding-bottom: 0.25rem;
    width: 100%;
    box-sizing: border-box;
}

.operation-card {
    display: grid;
    grid-template-columns: 0.8fr 0.35fr;
    gap: 0.5rem;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

.operation-text {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: #111827;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    max-height: 100%;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.operation-answer {
    background: #1e293b;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.operation-answer.show {
    display: flex;
}

.ski-run-footer {
    display: grid;
    grid-template-columns: 0.8fr 0.35fr;
    gap: 0.5rem;
    flex-shrink: 0;
}

.final-answer-box {
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.final-answer-box:hover {
    background: rgba(30, 41, 59, 0.8);
}

.final-answer-label {
    display: none;
}

.final-answer-value {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
}

.final-answer-box.empty .final-answer-value {
    font-size: 3rem;
    color: #94a3b8;
}

.answer-controls {
    display: none;
}

.answer-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Roboto', sans-serif;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.answer-btn.blue {
    background: #3b82f6;
    border-color: #3b82f6;
    min-width: 150px;
    width: 150px;
}

.answer-btn.blue:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.show-all-answers-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-shrink: 0;
}