@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;1,300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #14172a;
    color: #e7e9f5;
    min-height: 100vh;
}

.page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.sub {
    color: #9aa0c0;
    margin-bottom: 28px;
    line-height: 1.5;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 760px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: #1c2038;
    border: 1px solid #2c3357;
    border-radius: 10px;
    padding: 20px;
}

.settings h2, .history-panel h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #b7bde0;
}

.rule-text {
    font-size: 13px;
    color: #9aa0c0;
    line-height: 1.9;
    margin-bottom: 16px;
}

.rule-text b {
    color: #cfd3ec;
}

.start-btn, .check-btn {
    width: 100%;
    padding: 12px;
    background: #35406B;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s background;
}

.start-btn:hover, .check-btn:hover {
    background: #465490;
}

.check-btn {
    margin-top: 20px;
    max-width: 300px;
}

.production-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #6B2B2B;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s background;
}

.production-btn:hover {
    background: #8a3838;
}

.production-desc {
    margin-top: 8px;
    font-size: 11px;
    color: #8b91b8;
}

.round-indicator {
    font-size: 13px;
    color: #9aa0c0;
    min-height: 18px;
}

.stats {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #2c3357;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 13px;
}

.stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats span {
    color: #8b91b8;
    font-size: 11px;
}

.stats b {
    font-size: 16px;
}

.game-area {
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.time-display {
    font-family: 'Roboto Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    color: #30ECCA;
}

.target-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.target-label {
    font-size: 11px;
    letter-spacing: 1px;
    color: #8b91b8;
}

#targetImg {
    background: #1A1D2C;
    border: 2px solid #35406B;
    border-radius: 8px;
    width: 220px;
    height: 220px;
    object-fit: contain;
}

.status-text {
    font-size: 15px;
    font-weight: 700;
    min-height: 22px;
}

.components {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: repeat(2, 80px);
    gap: 10px;
}

.tile {
    position: relative;
    width: 80px;
    height: 80px;
    border: 2px solid #2c3357;
    border-radius: 8px;
    background: #1A1D2C;
    cursor: pointer;
    overflow: hidden;
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.tile.cursor {
    border-color: #465490;
    box-shadow: 0 0 0 2px rgba(70, 84, 144, .5);
}

.tile.selected {
    border-color: #DDEC30;
    box-shadow: 0 0 10px rgba(221, 236, 48, .5);
}

.tile.correct {
    border-color: #30EC7B;
    box-shadow: 0 0 10px rgba(48, 236, 123, .6);
}

.tile.wrong {
    border-color: #EC3030;
    box-shadow: 0 0 10px rgba(236, 48, 48, .6);
}

.history-panel {
    overflow-x: auto;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-empty {
    color: #565c85;
    font-size: 13px;
}

.history-item {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 6px;
    background: #1A1D2C;
    border: 1px solid #2c3357;
}

.history-item.best {
    background: #4a3f0a;
    border-color: #DDEC30;
    color: #FFD700;
}

.credit {
    margin-top: 16px;
    font-size: 11px;
    color: #565c85;
}

.credit a {
    color: #8b91b8;
}
