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

body {
    font-family: 'Courier New', monospace;
    background-color: #ffffff;
    color: #000000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background-color: #ffffff;
    border: 2px solid #000000;
    padding: 40px;
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.display-container {
    position: relative;
    width: 100%;
    max-width: 1800px;
    padding: clamp(16px, 4vw, 40px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    min-height: 80px;
}

.display-header h2 {
    margin-bottom: 0;
}

.display-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: bold;
    letter-spacing: 2px;
}

h2 {
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border: 2px solid #000000;
    box-shadow: 0 0 0 2px #000000;
}

.btn-primary {
    padding: 15px 40px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #ffffff;
    color: #000000;
}

.btn-primary:active {
    transform: translateY(2px);
}

.seed-info {
    font-size: 20px;
    margin-bottom: 40px;
    padding: 15px 20px;
    border: 3px solid #000000;
    background-color: #ffffff;
    font-weight: bold;
    text-align: center;
}

.digit-display {
    font-weight: 900;
    color: #000000;
    background-color: #ffffff;
    text-align: center;
    letter-spacing: 0.02em;
    font-family: 'Courier New', monospace;
    padding: 20px;
    margin: 20px 0;
    line-height: 1.2;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: none;
    flex: 1;
    overflow: hidden;
}

.digit-display.show {
    opacity: 1;
    transform: scale(1);
}

.digit-row {
    font-weight: 900;
    color: #000000;
    background-color: #ffffff;
    text-align: center;
    letter-spacing: 0.02em;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    line-height: 1.2;
    margin: 2px 0;
}

.btn-refresh {
    padding: 12px 30px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
    margin-top: 30px;
}

.btn-refresh:hover {
    background-color: #ffffff;
    color: #000000;
}

.btn-refresh:active {
    transform: translateY(2px);
}

.timer {
    font-size: 28px;
    margin-bottom: 30px;
    padding: 20px;
    border: 3px solid #000000;
    background-color: #ffffff;
    font-weight: bold;
    text-align: center;
}

.timer.countdown {
    margin-bottom: 0;
    min-width: 160px;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .display-container {
        padding: clamp(12px, 6vw, 20px);
    }

    .display-header {
        min-height: 60px;
        margin-bottom: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .display-content {
        flex: 1;
    }

    .digit-display {
        font-size: clamp(36px, 9vw, 64px);
        padding: 30px 15px;
        gap: 15px;
    }

    .digit-row {
        font-size: clamp(36px, 9vw, 64px);
    }

    h1 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    h2 {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .seed-info {
        font-size: 16px;
        padding: 12px 15px;
        margin-bottom: 30px;
    }

    .timer {
        font-size: 22px;
        padding: 15px;
    }

    .btn-primary {
        padding: 12px 30px;
        font-size: 14px;
    }

    .btn-refresh {
        padding: 10px 25px;
        font-size: 14px;
    }
}

@media (max-width: 560px) {
    .display-header {
        min-height: 50px;
        margin-bottom: 10px;
    }

    .digit-display {
        font-size: clamp(32px, 8vw, 56px);
        padding: 25px 12px;
        gap: 12px;
    }

    .digit-row {
        font-size: clamp(32px, 8vw, 56px);
    }
}

@media (max-width: 420px) {
    .display-header {
        min-height: 40px;
        margin-bottom: 8px;
    }

    .timer {
        font-size: 18px;
        padding: 14px;
    }

    .seed-info {
        font-size: 14px;
    }

    h2 {
        font-size: 20px;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 14px;
    }

    .digit-display {
        font-size: clamp(28px, 7vw, 48px);
        padding: 20px 10px;
        gap: 10px;
    }

    .digit-row {
        font-size: clamp(28px, 7vw, 48px);
    }

    .btn-refresh {
        padding: 8px 20px;
        font-size: 12px;
    }
}

@media (min-width: 1800px) {
    .timer {
        font-size: 40px;
    }
    .digit-display {
        font-size: clamp(64px, 8vw, 120px);
        gap: 25px;
    }

    .digit-row {
        font-size: clamp(64px, 8vw, 120px);
    }
}