@font-face {
    font-family: "EA Display";
    src: url("https://eaaccounts.akamaized.net/resource_signin_ea_com/551.0.20250830.1116.4e0e3623ff71/p/statics/juno/css/fonts/electronic-arts-display-bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0f1016;
    --panel: #1a1d28;
    --panel-2: #151824;
    --text: #e8eaf1;
    --muted: #9097a6;
    --accent: #3B82F6;
    --accent-2: #60A5FA;
    --border: #232635;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg), #0b0d14 60%, #0b0d14);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* общий контейнер: шапка + приложение */
.stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* шапка */
.site-header {
    display: flex;
    justify-content: center;
    width: 100%;
}


.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    padding: 10px 14px;
    border-radius: 12px;

    /* всегда видимая “рамка” и фон */
    border: 1px solid var(--border);
    background: var(--panel);

    /* лёгкая внутренняя линия, чтобы “края” читались лучше на тёмном фоне */
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);

    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
    font-family: "EA Display", sans-serif;
}

.brand:hover {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 6px 18px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}



.brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-title {
    font-weight: 800;
    letter-spacing: 1.2px;
    font-size: 32px;
}

/* карточка генератора */
.app {
    width: 480px;

    /* фон и рамка — такие же, как у .brand */
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 8px 32px rgba(0, 0, 0, .4);

    border-radius: 12px;
    /* такой же радиус, как у brand */
    padding: 22px 22px 18px;
}

.title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    letter-spacing: .3px;
    margin-bottom: 14px;
}

.field {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.field input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 14px;
    letter-spacing: .2px;
    text-align: center;
}

.codes {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.row {
    display: flex;
    align-items: stretch;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.cell {
    flex: 1;
    padding: 12px 8px;
    position: relative;
    background: var(--panel-2);
    display: flex;
    flex-direction: column;
}

.cell h4 {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.code {
    font-family: "EA Display", sans-serif;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 28px;
    letter-spacing: 3px;
    user-select: none;
    transition: opacity .18s ease;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 44px;
    line-height: 1;
    padding-bottom: 8px;
}

#prev,
#next {
    font-size: 20px;
}

.current {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.progress {
    height: 8px;
    background: #0c1020;
    position: relative;
}

.progress>div {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s linear;
}

.timer {
    font-size: 12px;
    color: var(--muted);
    padding: 8px 10px 10px;
    text-align: center;
    min-height: 22px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: #0c1222;
    color: #cfe0ff;
    border: 1px solid #1f2a44;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.toast.show {
    opacity: 1
}

@keyframes flashCell {
    0% {
        background-color: var(--panel-2);
    }

    30% {
        background-color: rgba(96, 165, 250, .18);
    }

    100% {
        background-color: var(--panel-2);
    }
}

.cell.flash {
    animation: flashCell .42s ease;
}



/* ========= MOBILE / TABLET ========= */
@media (max-width: 720px) {

    /* общий лэйаут */
    body {
        padding: 12px;
        align-items: flex-start;
        /* чтобы шапка не прилипала к самому верху экрана */
    }

    .stack {
        gap: 10px;
        width: 100%;
    }

    /* шапка */
    .brand {
        padding: 10px 14px;
        border-radius: 10px;
    }

    .brand img {
        width: 28px;
        height: 28px;
    }

    .brand-title {
        font-size: 22px;
        letter-spacing: .2px;
    }

    /* карточка */
    .app {
        width: 100%;
        border-radius: 10px;
        padding: 16px 14px 14px;
    }

    .title {
        margin-bottom: 10px;
        font-size: 16px;
    }

    /* поле ввода: 16px чтобы iOS не делал зум */
    .field {
        padding: 8px;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .field input {
        font-size: 16px;
        padding: 8px 4px;
    }

    /* блок кодов */
    .codes {
        border-radius: 10px;
    }



    .cell {
        padding: 10px 6px;
    }

    .cell h4 {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .code {
        height: 40px;
        /* «окно» под цифры чуть ниже */
        padding-bottom: 6px;
        font-size: 24px;
        /* текущий код */
        letter-spacing: 2px;
    }

    /* prev/next чуть меньше */
    #prev,
    #next {
        font-size: 18px;
    }

    .progress {
        height: 6px;
    }

    .timer {
        font-size: 12px;
        padding: 6px 8px 8px;
        min-height: 18px;
    }
}

/* узкие экраны — ещё сильнее ужимаем цифры */
@media (max-width: 380px) {
    .brand {
        padding: 8px 12px;
    }

    .brand-title {
        font-size: 18px;
    }

    .code {
        font-size: 21px;
        letter-spacing: 1px;
        height: 36px;
        padding-bottom: 5px;
    }

    #prev,
    #next {
        font-size: 17px;
    }
}






.download-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    font-family: "EA Display", sans-serif;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.download-btn:hover {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .25);
    transform: translateY(-1px);
}