:root {
    --bg-color: #f0f4f8;
    --primary: #4f46e5; /* Indigo */
    --accent: #10b981; /* Emerald */
    --error: #ef4444;
    --text: #1e293b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    margin: 0;
    display: flex;
    justify-content: center;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling on game screens */
}

#app-container {
    width: 100%;
    max-width: 500px;
    background: white;
    height: 100%;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hidden { display: none !important; }

/* Buttons */
button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    margin: 10px;
    font-weight: bold;
    touch-action: manipulation; /* Improves touch response */
}

button:active { transform: scale(0.95); }
.secondary-btn { background: #94a3b8; font-size: 0.9rem; }
.print-btn { background: var(--text); }

/* Map */
.map-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
    padding: 20px;
    overflow-y: auto;
}

.island-card {
    background: #e0e7ff;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--primary);
    cursor: pointer;
}
.island-card.locked {
    background: #cbd5e1;
    border-color: #94a3b8;
    opacity: 0.7;
    pointer-events: none;
}

/* Battle */
.battle-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.question { font-size: 4rem; font-weight: bold; margin: 20px 0; }
#input-display {
    font-size: 3rem;
    height: 60px;
    border-bottom: 3px solid var(--primary);
    margin-bottom: 20px;
    min-width: 100px;
}

/* Numpad */
.numpad { width: 100%; max-width: 350px; }
.keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.keys button {
    margin: 0;
    padding: 20px 0;
    font-size: 1.5rem;
    background: #f1f5f9;
    color: var(--text);
    border: 1px solid #cbd5e1;
}
.keys .submit-btn { background: var(--accent); color: white; }
.keys .action-btn { font-weight: bold; }

/* Visual Hint (Dots) */
.visual-hint {
    display: grid;
    gap: 2px;
    margin-bottom: 10px;
}
.dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; }