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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Georgia', serif;
    background: #1a1a1a;
    color: #e8e3d3;
}

/* Контейнер-рамка для десктопа: картинка по центру, по бокам — серый фон */
#frame {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px; /* ширина "мобильного" блока на десктопе */
    height: 100%;
    overflow: hidden;
}

#bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/public/media/bg.png');
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.55);
    z-index: 1;
}

#content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 1.3em;
    font-weight: normal;
    letter-spacing: 1px;
    color: #c9a85c;
    margin-bottom: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

#countdown {
    font-family: 'Courier New', Courier, monospace; /* моноширинный шрифт — цифры не дёргаются */
    font-size: 2.2em;
    letter-spacing: 3px;
    color: #f0e6c8;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    margin-bottom: 30px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#address {
    font-size: 1em;
    line-height: 1.6;
    color: #cfc8ae;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.1em;
    }
    #countdown {
        font-size: 1.6em;
        letter-spacing: 2px;
    }
    #address {
        font-size: 0.9em;
    }
}

#countdown-screen, #quest-screen {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    overflow-y: auto;
}

#quest-screen {
    justify-content: flex-start;
    padding-top: 40px;
}

.screen-text {
    white-space: pre-line;
    line-height: 1.6;
    font-size: 1.05em;
    margin-bottom: 20px;
}

img.story-img {
    max-width: 100%;
    display: block;
    margin: 20px auto;
    border: 2px solid #333;
}

.code-form {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    width: 100%;
}

.code-form input[type=text] {
    flex: 1;
    padding: 10px;
    background: #1a1a1f;
    border: 1px solid #555;
    color: #e8e3d3;
}

.code-form button {
    padding: 10px 18px;
    background: #c9a85c;
    border: none;
    color: #0d0d10;
    font-weight: bold;
}

#error-msg {
    color: #d35454;
    margin-top: 10px;
    min-height: 1.2em;
}

.progress {
    text-align: center;
    font-size: 0.8em;
    color: #777;
    margin-top: 20px;
}

#reset-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(20, 20, 24, 0.7);
    color: #c9a85c;
    border: 1px solid #555;
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reset-btn:hover {
    background: rgba(40, 40, 46, 0.9);
}
