/* --- START OF FILE tutorial-ui.css --- */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* --- CHOICE OVERLAY (START SCREEN) --- */
#tutorial-choice-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000; /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

#tutorial-choice-overlay.hidden {
    display: none;
}

.choice-card {
    background: #202028;
    border: 4px solid #fff;
    outline: 4px solid #000;
    padding: 30px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    animation: dropIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 400px;
    width: 90%;
}

@keyframes dropIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.choice-card h1 {
    font-size: 20px;
    color: #fbbf24;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0 #000;
}

.choice-subtitle {
    font-size: 10px;
    color: #cbd5e1;
    margin-bottom: 25px;
    line-height: 1.5;
}

.choice-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-choice {
    font-family: inherit;
    border: 2px solid #000;
    padding: 12px 16px;
    font-size: 10px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

.btn-choice:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

.btn-choice.primary {
    background: #22c55e;
    color: #fff;
    border-color: #fff;
}

.btn-choice.secondary {
    background: #475569;
    color: #cbd5e1;
    border-color: #94a3b8;
}

/* --- MAIN TUTORIAL PANEL --- */

#tutorial-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1300;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    padding: 10px;
    box-sizing: border-box;
}

#tutorial-overlay.hidden {
    display: none;
}

#tutorial-panel {
    width: 100%;
    max-width: 500px;
    background: #202028;
    border: 4px solid #fff;
    outline: 4px solid #000;
    box-shadow: 12px 12px 0px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    padding: 24px;
    color: white;
    font-family: 'Press Start 2P', cursive, monospace;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 400px;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #000;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 16px;
    color: #fbbf24;
    text-shadow: 2px 2px 0 #000;
}

#tutorial-close {
    background: #ef4444;
    border: 2px solid #fff;
    color: white;
    font-family: inherit;
    width: 32px; height: 32px;
    cursor: pointer;
    box-shadow: 2px 2px 0 #000;
}

/* SLIDES CONTAINER */
.tutorial-content-slides {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.slide {
    display: none;
    flex-direction: column;
    gap: 15px;
    animation: fadeInSlide 0.3s ease-out;
    height: 100%;
}

.slide.active {
    display: flex;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* CONTENT STYLES */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.control-group h3 {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 5px 0;
    border-left: 4px solid #3b82f6;
    padding-left: 8px;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    padding: 10px;
    border: 2px solid #333;
}

.label {
    font-size: 10px;
    color: #ccc;
}

.keys-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.key-row {
    display: flex;
    gap: 4px;
}

.key {
    width: 24px; height: 24px;
    background: #e2e8f0;
    color: #000;
    border-bottom: 4px solid #94a3b8;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 0 #000;
}

.hint {
    font-size: 8px;
    color: #64748b;
    font-style: italic;
}

.action-text {
    font-size: 10px;
    color: #fbbf24;
}

.tips-section {
    background: #1e293b;
    padding: 15px;
    border: 2px dashed #475569;
    font-size: 9px;
    line-height: 1.8;
    color: #cbd5e1;
}

.ui-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
}

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

/* FOOTER NAVIGATION */
.tutorial-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 4px solid #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-footer button {
    font-family: inherit;
    background: #3b82f6;
    color: white;
    border: 2px solid #000;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 10px;
    box-shadow: 2px 2px 0 #000;
}

.tutorial-footer button:disabled {
    background: #334155;
    color: #64748b;
    cursor: default;
    box-shadow: none;
}

.tutorial-footer button:not(:disabled):active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.slide-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px; height: 8px;
    background: #334155;
    border: 1px solid #000;
}

.dot.active {
    background: #fbbf24;
    box-shadow: 0 0 5px #fbbf24;
}

@media (max-width: 600px) {
    #tutorial-panel {
        width: 95%;
        padding: 15px;
        min-height: 350px;
    }
    .tutorial-header h2 { font-size: 14px; }
    .control-row { padding: 8px; }
}
