@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;
}

@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;
}

.field {
    display: block;
    margin-bottom: 16px;
    font-size: 13px;
    color: #cfd3ec;
}

.field span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.field input[type="range"] {
    width: 100%;
}

.field.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field.checkbox span {
    display: inline;
    margin-bottom: 0;
}

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

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

.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: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.crack-status {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    color: #9aa0c0;
}

.timer-bar {
    background: #1A1D2C;
    height: 8px;
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
    visibility: hidden;
}

.timer-bar.active {
    visibility: visible;
}

.timer-bar-inner {
    width: 100%;
    height: 100%;
    background: #35406B;
    transition: width .1s linear, background .2s linear;
}

.timer-bar-inner.danger {
    background: #EC3030;
}

.digits {
    display: flex;
    gap: 10px;
}

.digit {
    width: 52px;
    height: 60px;
    background: #1f2336;
    border: 2px solid #2c3357;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 26px;
    font-weight: 700;
    transition: .15s background, .15s border-color;
}

.digit.correct {
    background: #1a2e24;
    border-color: #30EC7B;
    color: #30EC7B;
}

.digit.wrong-position {
    background: #332e12;
    border-color: #DDEC30;
    color: #DDEC30;
}

.digit.not-in-pin {
    background: #2e1a1a;
    border-color: #EC3030;
    color: #EC3030;
}

.digit.shake {
    animation: shake .3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.crack-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
}

.crack-btn, .delete-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .15s background;
}

.crack-btn {
    background: #35406B;
    color: white;
}

.crack-btn:hover {
    background: #465490;
}

.delete-btn {
    background: #1f2336;
    color: #cfd3ec;
    border: 1px solid #2c3357;
}

.delete-btn:hover {
    border-color: #465490;
}

.result-message {
    font-size: 16px;
    font-weight: 700;
    min-height: 22px;
}

.result-message.success {
    color: #30EC7B;
}

.result-message.fail {
    color: #EC3030;
}

.history-panel {
    margin-top: 24px;
    overflow-x: auto;
}

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

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

.history-entry {
    display: flex;
    gap: 6px;
}

.history-digit {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    background: #1f2336;
    border: 1px solid #2c3357;
}

.history-digit.correct {
    background: #1a2e24;
    border-color: #30EC7B;
    color: #30EC7B;
}

.history-digit.wrong-position {
    background: #332e12;
    border-color: #DDEC30;
    color: #DDEC30;
}

.history-digit.not-in-pin {
    background: #2e1a1a;
    border-color: #EC3030;
    color: #EC3030;
}
