:root {
    --primary: #2A8E9D;
    /* Dinosaur Teal */
    --primary-hover: #1E6F7A;
    --navy: #0E344A;
    /* Book/Outline Navy */
    --gold: #FFC812;
    /* Crown Gold */
    --bg-color: #F9F4E8;
    /* Logo Background Cream */
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0E344A;
    --text-muted: #56788A;
    --card-shadow: 0 10px 30px rgba(14, 52, 74, 0.1);
    --success: #22c55e;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    /* Cream Background */
    /* Add subtle pattern at the edges if possible */
    background-image:
        radial-gradient(circle at top right, rgba(42, 142, 157, 0.05), transparent),
        radial-gradient(circle at bottom left, rgba(255, 200, 18, 0.05), transparent);
    color: var(--text-main);
    min-height: 100vh;
}

/* Hide Latin Class for Hard Mode */
body.hard-mode .latin,
body.hard-mode .k-label {
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden;
}

.app-container {
    max-width: 950px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    transition: all 0.3s ease;
}

header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ====== START SCREEN / SPLASH ====== */
#start-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(160deg, #0E344A 0%, #1a4a62 40%, #2A8E9D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
}

#start-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 200, 18, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(42, 142, 157, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

#start-screen.dismissed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: startFloat 1s ease-out forwards;
    position: relative;
    z-index: 1;
}

@keyframes startFloat {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.start-logo {
    width: 260px;
    height: 260px;
    border-radius: 40px;
    object-fit: cover;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(42, 142, 157, 0.2);
    border: 5px solid rgba(255, 255, 255, 0.15);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 80px rgba(42, 142, 157, 0.2);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 100px rgba(42, 142, 157, 0.3);
    }
}

.start-text {
    text-align: center;
}

.start-title {
    font-family: 'Outfit', sans-serif !important;
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.start-tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    letter-spacing: 1px;
}

.start-cta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: ctaFade 2s ease-in-out infinite;
}

@keyframes ctaFade {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.start-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.6);
        opacity: 0.4;
    }
}

/* ====== HEADER LOGO (Left-aligned) ====== */
.header-logo {
    position: absolute;
    left: 0;
    top: 0;
    width: 140px;
    height: 140px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(14, 52, 74, 0.15);
    border: 4px solid rgba(42, 142, 157, 0.15);
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05) rotate(-2deg);
}

header h1 {
    font-family: 'Noto Sans Javanese', serif;
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 0.2rem;
    line-height: 1.2;
    text-shadow: 2px 2px 0px rgba(14, 52, 74, 0.1);
}

header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--navy);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

header .tagline {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

/* Toggle Switch Styles */
.hard-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(14, 52, 74, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    border: 2px solid rgba(14, 52, 74, 0.1);
    margin-top: 1rem;
}

.hard-mode-toggle span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #475569;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--error);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--error);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

#btn-home {
    position: absolute;
    left: 0;
    top: 0;
    background: var(--navy);
    border: none;
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(14, 52, 74, 0.2);
    z-index: 10;
}

#btn-home:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.hidden {
    display: none !important;
}

.view {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view.active {
    display: block;
}

.view>div>h3,
.view>h3 {
    font-size: 1.8rem;
    color: var(--navy);
    /* Contrast Fix */
}

.desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Dashboard */
.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.level-card {
    background: white;
    border: 4px solid white;
    border-radius: 25px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--card-shadow);
    color: var(--navy);
}

.level-card:hover:not(.locked) {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(42, 142, 157, 0.15);
}

.level-icon {
    font-family: 'Noto Sans Javanese', serif;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    height: 140px;
    font-size: 7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 5px 15px rgba(42, 142, 157, 0.2));
}

.level-card h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: var(--navy);
}

.level-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.4;
}

.level-card.pvp {
    border: 4px dashed var(--gold);
    background: rgba(255, 200, 18, 0.05);
}

.level-card.pvp h3 {
    color: #b45309;
}

.level-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Level 1 Flashcards */
.mnemonic-bar {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    justify-content: center;
    padding: 1rem;
    background: rgba(14, 52, 74, 0.03);
    border-radius: 60px;
}

.mnemonic-bar button {
    background: white;
    border: 2px solid #e2e8f0;
    color: var(--text-muted);
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.mnemonic-bar button:hover,
.mnemonic-bar button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(42, 142, 157, 0.3);
}

.flashcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.2rem;
}

.flashcard {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 3px solid #f1f5f9;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.flashcard:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(42, 142, 157, 0.1);
}

.flashcard .javanese {
    font-family: 'Noto Sans Javanese', serif;
    font-size: 4.5rem;
    display: block;
    margin-bottom: 0.8rem;
    color: var(--navy);
    line-height: 1.2;
    transition: transform 0.3s ease;
}

.flashcard:hover .javanese {
    transform: scale(1.1);
}

.flashcard .latin {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(42, 142, 157, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    display: inline-block;
    transition: opacity 0.3s;
}

/* Level 2 Minigame (Drag & Drop) */
.minigame-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.target-word {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.2rem;
    background: var(--navy);
    color: white;
    border-radius: 15px;
    letter-spacing: 2px;
}

.btn-next-q {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: 0.2s;
    font-size: 0.9rem;
}

.btn-next-q:hover {
    background: var(--primary);
}

.conveyor-belt {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.2);
}

.char-slot {
    width: 180px;
    height: 220px;
    border: 4px dashed #cbd5e1;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #ffffff;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.char-slot.drag-over {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.2);
    transform: scale(1.05);
}

.slot-content {
    font-family: 'Noto Sans Javanese', serif;
    font-size: 6rem;
    line-height: normal;
    color: var(--navy);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.05);
    pointer-events: none;
    font-feature-settings: "kern" 1, "liga" 1, "clig" 1;
}

.slot-hint {
    position: absolute;
    bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    pointer-events: none;
}

.toolbox {
    text-align: center;
    margin-bottom: 2rem;
}

.toolbox h4 {
    color: var(--text-muted);
    font-weight: 500;
}

.tools {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.tool-drag {
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.2rem;
    cursor: grab;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 110px;
    transition: 0.2s;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.tool-drag:active {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.tool-drag:hover {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.1);
}

.tool-drag .tool-uni {
    font-family: 'Noto Sans Javanese', serif;
    font-size: 4rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.8rem;
    pointer-events: none;
}

.tool-drag .tool-name {
    font-size: 0.9rem;
    color: var(--text-main);
    pointer-events: none;
    transition: opacity 0.3s;
}

.btn-reset {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: 0.2s;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: #fca5a5;
}

/* Level 3 Virtual Keyboard */
.eval-box {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.virtual-display-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.javanese-display {
    flex: 1;
    min-height: 100px;
    padding: 1.2rem 2rem;
    font-family: 'Noto Sans Javanese', serif;
    font-size: 4rem;
    background: #f1f5f9;
    border: 3px solid #e2e8f0;
    color: var(--navy);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    line-height: normal;
    font-feature-settings: "kern" 1, "liga" 1, "clig" 1;
}

.btn-backspace {
    background: #fecaca;
    border: none;
    color: #dc2626;
    border-radius: 18px;
    padding: 0 1.5rem;
    font-weight: 800;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: 0.2s;
    font-size: 1.5rem;
}

.btn-backspace:hover {
    background: rgba(239, 68, 68, 0.3);
}

.keyboard-container {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
}

.keyboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    overflow-x: auto;
}

.k-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
    white-space: nowrap;
}

.k-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.k-tab.active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    font-weight: 600;
}

.keyboard-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 0.5rem;
}

.keyboard-grid.active {
    display: grid;
}

.k-btn {
    background: rgba(30, 41, 59, 1);
    border: 1px solid #475569;
    color: white;
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    font-family: 'Noto Sans Javanese', serif;
    font-size: 2.2rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    line-height: normal;
}

.k-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(99, 102, 241, 0.3);
}

.k-btn .k-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    transition: opacity 0.3s;
}

.k-btn:hover .k-label {
    color: white;
}

/* Shared */
.check-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(to right, var(--primary), #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}

.check-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.feedback {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    font-size: 1.1rem;
    display: none;
    animation: fadeIn 0.3s;
    white-space: pre-line;
}

.feedback.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.feedback.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .start-logo {
        width: 180px;
        height: 180px;
        border-radius: 30px;
    }

    .start-title {
        font-size: 2.2rem;
    }

    .header-logo {
        position: static;
        width: 80px;
        height: 80px;
        border-radius: 18px;
        margin-bottom: 0.8rem;
    }

    header h1 {
        font-size: 2.8rem;
    }

    .app-container {
        padding: 1rem;
    }

    #btn-home {
        position: static;
        transform: none;
        display: inline-block;
        margin: 1.5rem auto 1.5rem;
    }

    .flashcard .javanese {
        font-size: 2.8rem;
    }

    .conveyor-belt {
        gap: 1rem;
    }

    .char-slot {
        width: 110px;
        height: 140px;
    }

    .slot-content {
        font-size: 4rem;
    }

    .virtual-display-container {
        flex-direction: column;
    }

    .btn-backspace {
        padding: 1rem;
    }
}

/* ============================================
   MULTIPLAYER MODE — Optimized for 16:9 Landscape
   Interactive Digital Board (Papan Interaktif)
   ============================================ */

/* Wide container for battle mode */
.app-container.wide {
    max-width: 100%;
    padding: 0.8rem 1.2rem;
}

/* Full-height split layout */
.split-screen-container {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    height: calc(100vh - 140px);
    min-height: 500px;
}

/* Vertical divider glow */
.split-screen-container::before {
    content: "⚔️";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    z-index: 5;
    filter: drop-shadow(0 0 20px rgba(250, 204, 21, 0.6));
    pointer-events: none;
}

/* Player panels */
.player-panel {
    flex: 1;
    background: #fff;
    border-radius: 20px;
    border: 4px solid #f1f5f9;
    padding: 1.2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--card-shadow);
}

.player-panel.player1 {
    border-color: #93c5fd;
    /* Soft Blue */
}

.player-panel.player2 {
    border-color: #fca5a5;
    /* Soft Red */
}

/* Player header — compact & prominent */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    background: #f8fafc;
}

.player-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
}

.player1 .player-header h3 {
    color: #2563eb;
}

.player2 .player-header h3 {
    color: #dc2626;
}

.player-header .score {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy);
    background: white;
    padding: 0.3rem 1.2rem;
    border-radius: 12px;
}

.player1 .player-header .score {
    border: 3px solid #60a5fa;
}

.player2 .player-header .score {
    border: 3px solid #f87171;
}

/* Multiplayer keyboard — compact touch-friendly for digital board */
.player-panel .keyboard-container {
    flex: 1;
    background: #f8fafc;
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.player-panel .k-btn {
    background: white;
    color: var(--navy);
    /* Contrast Fix */
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.player-panel .k-btn .k-label {
    color: var(--text-muted);
}

/* Multiplayer eval-box — compact for landscape */
.player-panel .eval-box {
    padding: 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Multiplayer display area — shorter */
.player-panel .javanese-display {
    min-height: 55px;
    font-size: 2.2rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    color: var(--navy);
    /* Contrast Fix */
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

/* Multiplayer keyboard — compact touch-friendly for digital board */
.player-panel .keyboard-container {
    flex: 1;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
}

.player-panel .keyboard-tabs {
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    gap: 0.3rem;
}

.player-panel .k-tab {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.player-panel .keyboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 4px;
}

.player-panel .keyboard-grid.active {
    display: grid;
    align-content: start;
}

/* Large touch-friendly buttons for kids */
.player-panel .k-btn {
    font-family: 'Noto Sans Javanese', serif;
    padding: 0.4rem 0.2rem;
    font-size: 1.8rem;
    min-height: 60px;
    border-radius: 12px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    line-height: 1;
}

.player-panel .k-btn .k-label {
    font-size: 0.65rem;
    margin-top: 0.2rem;
    color: var(--text-muted);
}

/* Multiplayer submit button */
.player-panel .check-btn {
    padding: 0.7rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    border-radius: 10px;
}

.player1 .check-btn {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
}

.player2 .check-btn {
    background: linear-gradient(135deg, #ef4444, #f97316);
}

/* Multiplayer feedback — compact */
.player-panel .feedback {
    margin-top: 0.4rem;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Virtual display compact */
.player-panel .virtual-display-container {
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.player-panel .btn-backspace {
    padding: 0 0.8rem;
    font-size: 1.4rem;
    min-width: 55px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.player-panel .btn-backspace:hover {
    background: #fecaca;
}

/* Challenge text */
.player-panel .challenge {
    margin-bottom: 0.5rem !important;
}

/* ============================================
   RESPONSIVE: fallback to stacked on narrow screens
   ============================================ */
@media (max-width: 900px) {
    .split-screen-container {
        flex-direction: column;
        height: auto;
    }

    .split-screen-container::before {
        display: none;
    }

    .player-panel .k-btn {
        font-size: 1.8rem;
        min-height: 56px;
    }
}

/* Landscape fullscreen optimization for digital boards */
@media (min-width: 1024px) and (min-aspect-ratio: 4/3) {
    .split-screen-container {
        height: calc(100vh - 120px);
    }

    .player-panel .keyboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    }

    .player-panel .k-btn {
        min-height: 56px;
        font-size: 1.8rem;
    }
}