:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #00e5ff; 
    --secondary-color: #ff0055;
    --text-color: #e0e0e0;
    --border-color: #333;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    min-height: 100vh;
}

header {
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
    box-sizing: border-box;
    border-bottom: 1px solid var(--border-color);
}

.brand { display: flex; align-items: center; gap: 15px; }
h1 { margin: 0; font-size: 1.5rem; }
.highlight { color: white; }

.level-badge {
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.dropdown {
    background: var(--surface-color);
    color: white;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 4px;
}

.sudoku-layout { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
    justify-content: center;
    width: 100%;
    max-width: 500px;
}

.hearts-sidebar { 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}

.heart-icon { width: 30px; height: 30px; }

.board {
    display: grid;
    grid-template-columns: repeat(9, 1fr); 
    grid-template-rows: repeat(9, 1fr);
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1 / 1;
    border: 3px solid white;
    background: var(--surface-color);
}

.board input {
    width: 100%; 
    height: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color); /* Restored borders so boxes show! */
    color: white;
    font-size: clamp(1rem, 4vw, 1.2rem); 
    text-align: center;
    box-sizing: border-box;
    margin: 0;
    outline: none;
}

/* 3x3 Grid Thicker Borders */
.board input:nth-child(3n) { border-right: 2px solid white; }
.board input:nth-child(9n) { border-right: none; }
.board input:nth-child(n+19):nth-child(-n+27),
.board input:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid white; }

.board input.correct { color: #00ff00; }
.board input.wrong { color: #ff0055; }
.board input.prefilled { background: #252525; color: #888; }
/* Yellow highlight for matching numbers */
.board input.highlight-match {
    background-color: #ffeb3b !important; /* Bright Yellow */
    color: #000 !important; /* Black text for contrast */
    text-shadow: none;
}

.number-pad {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
    max-width: 400px;
}

.n-key {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.brand { display: flex; align-items: center; gap: 15px; }
.highlight { color: var(--primary-color); }

.n-key.completed { opacity: 0.3; pointer-events: none; }

.btn-primary { background: var(--primary-color); color: black; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.controls { width: 100%; max-width: 400px; display: flex; justify-content: center; }
.btn-action { background: #333; color: white; border: 1px solid #555; padding: 12px 20px; cursor: pointer; width: 100%; border-radius: 4px; font-weight: bold;}

.status-msg { margin-top: 15px; font-weight: bold; height: 20px;}


/* Penguin */
/* Center the penguin inside the board area */
.penguin-container {
    display: none; /* Hidden by default */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centers it exactly */
    z-index: 10;
    pointer-events: none;
}

.penguin-container.show {
    display: block;
    animation: penguinBounce 0.5s ease-in-out infinite alternate;
}

/* The Penguin Body */
.penguin {
    position: relative;
    width: 120px;
    height: 150px;
    background: #000; /* Black Body */
    border-radius: 50% 50% 30% 30%;
}

/* The White Tummy */
.penguin::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 20px;
    width: 80px;
    height: 100px;
    background: #fff; /* White Tummy */
    border-radius: 50%;
}

.eye {
    position: absolute;
    top: 40px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    z-index: 2;
}
.eye.left { left: 35px; }
.eye.right { right: 35px; }

/* Pupils */
.eye::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    top: 3px;
    left: 3px;
}

.beak {
    position: absolute;
    top: 60px;
    left: 50px;
    width: 20px;
    height: 15px;
    background: #ff9800; /* Orange Beak */
    border-radius: 50%;
    z-index: 2;
}

@keyframes penguinBounce {
    from { transform: translate(-50%, -50%); }
    to { transform: translate(-50%, -60%); }
}