:root {
    --bg-dark: #0a0b10;
    --card-bg: rgba(255, 255, 255, 0.05);
    --accent-blue: #00f2ff;
    --accent-purple: #bc13fe;
    --correct: #4ade80;
    --present: #2dd4bf;
    --absent: #3f3f46;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Game-specific styles */

.sub-instruction {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.8;
}

.color-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.color-dot.correct { background: var(--correct); box-shadow: 0 0 5px var(--correct); }
.color-dot.present { background: var(--present); box-shadow: 0 0 5px var(--present); }
.color-dot.absent { background: var(--absent); border: 1px solid rgba(255,255,255,0.1); }

.ambient-glow {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.bingo-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Game Container Styling */
.game-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    backdrop-filter: blur(20px);
}

/* Target Slots */
.target-slots {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.slot {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.slot.active {
    border-color: var(--accent-blue);
    background: rgba(0, 242, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.1);
    transform: translateY(-5px);
}

/* Jamo Cloud */
.jamo-cloud-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
}

.jamo-cloud-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-blue);
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
}

.jamo-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.jamo-pill {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
    user-select: none;
}

.jamo-pill.hidden {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}

.jamo-pill.absent {
    background: rgba(0, 0, 0, 0.4);
    color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
    filter: grayscale(1);
    opacity: 0.5;
}

.jamo-pill.correct {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--correct);
    color: var(--correct);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.5);
}

.jamo-pill.present {
    background: rgba(45, 212, 191, 0.15);
    border-color: var(--present);
    color: var(--present);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.2);
    text-shadow: 0 0 5px rgba(45, 212, 191, 0.5);
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

#answer-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 10px;
    font-weight: 800;
}

#answer-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

.btn-submit:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* History Board */
.history-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
    align-items: center;
    margin-bottom: 10px;
}

.history-board::-webkit-scrollbar {
    width: 4px;
}

.history-board::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 2px;
}

.history-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.history-box {
    width: 50px;
    height: 50px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    transition: all 0.4s;
}

.history-box:empty {
    border-style: dashed;
    opacity: 0.3;
}

.history-box[data-state="correct"] { background: var(--correct); color: white; }
.history-box[data-state="present"] { background: var(--present); color: white; }
.history-box[data-state="absent"] { background: var(--absent); color: rgba(255,255,255,0.5); }

/* Rewards */
.btn-reward {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-reward:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

/* Animations */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes flip {
    0% { transform: rotateX(0); }
    45% { transform: rotateX(90deg); }
    55% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

.shake { animation: shake 0.5s ease-in-out; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

/* Modal and Toasts (from base) */
.message-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.2s forwards;
}

@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-20px); } }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: #111118;
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}
