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

:root {
    --bg-color: #2c3e50;
    --text-color: #ecf0f1;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --card-bg: #34495e;
}

body {
    font-family: 'Press Start 2P', 'PMingLiU', '新細明體', cursive;
    /* 8-bit font with Chinese fallback */
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 600px;
    /* Tablet size */
    padding: 20px;
}

/* Card Container */
.panel {
    background: var(--card-bg);
    border: 4px solid #000;
    box-shadow: 8px 8px 0 #000;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

/* Titles */
h1 {
    color: #f1c40f;
    text-shadow: 4px 4px 0 #000;
    font-size: 24px;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 20px;
    margin: 15px 0;
    font-family: inherit;
    font-size: 18px;
    color: white;
    background: var(--accent-color);
    border: 4px solid #000;
    box-shadow: 6px 6px 0 #000;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.1s;
}

.btn:active {
    transform: translate(4px, 4px);
    box-shadow: 2px 2px 0 #000;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-success {
    background: var(--success-color);
}

/* Inputs */
select,
input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 16px;
    background: #ecf0f1;
    border: 4px solid #000;
    box-sizing: border-box;
    /* Fix padding issue */
}

/* Game Interface */
.question-box {
    font-size: 48px;
    margin: 30px 0;
    color: #fff;
    text-shadow: 4px 4px 0 #000;
}

.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.key {
    background: #3498db;
    color: white;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 #000;
    padding: 20px;
    font-size: 24px;
    font-family: inherit;
    cursor: pointer;
}

.key:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

.key-enter {
    background: var(--success-color);
}

.key-del {
    background: var(--accent-color);
}

/* Heatmap */
.heatmap {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    margin-top: 20px;
    border: 4px solid #000;
    background: #000;
}

.cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: #555;
    color: white;
    /* Ensure text is visible */
    cursor: pointer;
}

.cell.good {
    background-color: #2ecc71;
}

.cell.avg {
    background-color: #f1c40f;
    color: black;
}

.cell.bad {
    background-color: #e74c3c;
}

/* New Heatmap Classes matching JS logic */
.cell-high {
    background-color: #27ae60;
}

.cell-med {
    background-color: #f1c40f;
    color: #2c3e50;
}

.cell-low {
    background-color: #c0392b;
}

.cell-none {
    opacity: 0.3;
}

/* Leaderboard */
.leaderboard-list {
    list-style: none;
    padding: 0;
    text-align: left;
}

.leaderboard-item {
    background: #2c3e50;
    border: 2px solid #000;
    margin-bottom: 5px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

.rank {
    color: #f1c40f;
    margin-right: 10px;
}