.retro-page, .retro-page * {
    box-sizing: border-box;
}

.retro-page {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.retro-page {
    min-height: 100vh;
    background: url(/assets/img/bg1.png) center top / cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
}

.retro-shell {
    width: 100%;
    max-width: 980px;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid rgba(74, 53, 30, 0.35);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.retro-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: url(/assets/img/bg2.jpg) center / cover no-repeat;
    border-bottom: 2px solid rgba(74, 53, 30, 0.25);
}

.retro-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.retro-brand img {
    height: 46px;
    width: auto;
    flex: 0 0 auto;
}

.retro-title {
    line-height: 1.1;
    min-width: 0;
}

.retro-title .name {
    font-family: "BreeSerif", "Roboto", serif;
    font-size: clamp(20px, 3vw, 26px);
    color: #4a351e;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.retro-title .sub {
    font-size: 13px;
    color: rgba(74, 53, 30, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.retro-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.retro-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    color: #4a351e;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(74, 53, 30, 0.18);
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.retro-nav a:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(74, 53, 30, 0.3);
}

.retro-nav a:active {
    transform: translateY(1px);
}

.retro-content {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
    padding: 18px;
    align-items: start;
}

.retro-hero {
    border: 1px solid rgba(74, 53, 30, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 16px;
}

.retro-hero h2 {
    margin: 0 0 10px 0;
    font-family: "BreeSerif", "Roboto", serif;
    color: #3b2a16;
    font-size: 20px;
}

.retro-hero p {
    margin: 0;
    color: rgba(59, 42, 22, 0.85);
    line-height: 1.6;
}

.retro-hero a {
    color: #7a4c18;
    font-weight: 700;
    text-decoration: none;
}

.retro-hero a:hover {
    text-decoration: underline;
}

.retro-panel {
    border: 1px solid rgba(74, 53, 30, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    padding: 14px;
}

.retro-panel h3 {
    margin: 0 0 12px 0;
    font-family: "BreeSerif", "Roboto", serif;
    color: #3b2a16;
    font-size: 18px;
}

.retro-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.retro-panel-head h3 {
    margin: 0;
}

.retro-panel-head[data-toggle] {
    cursor: pointer;
    user-select: none;
    padding: 2px 2px;
    border-radius: 10px;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.retro-panel-head[data-toggle]:hover {
    background: rgba(255, 255, 255, 0.85);
}

.retro-panel-head[data-toggle]:focus-visible {
    outline: 2px solid rgba(122, 76, 24, 0.35);
    outline-offset: 2px;
}

.retro-collapsible {
    margin-top: 10px;
}

.retro-panel-caret {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid rgba(59, 42, 22, 0.75);
    transition: transform 180ms ease;
    flex: 0 0 auto;
}

.retro-panel-head[aria-expanded="true"] .retro-panel-caret {
    transform: rotate(180deg);
}

.retro-login-panel h3 {
    margin-bottom: 8px;
}

.retro-login-desc {
    margin: 0 0 12px 0;
    color: rgba(59, 42, 22, 0.85);
    line-height: 1.6;
}

.retro-first-time-note {
    border: 1px solid rgba(122, 76, 24, 0.22);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 12px 12px;
    margin: 0 0 12px 0;
}

.retro-first-time-title {
    font-weight: 900;
    color: rgba(59, 42, 22, 0.95);
    margin: 0 0 8px 0;
}

.retro-first-time-list {
    margin: 0;
    padding-left: 18px;
    color: rgba(59, 42, 22, 0.82);
    line-height: 1.6;
}

.retro-first-time-list li {
    margin: 4px 0;
}

.retro-ack {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(74, 53, 30, 0.18);
    background: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-weight: 800;
    color: rgba(59, 42, 22, 0.9);
}

.retro-ack input {
    width: 18px;
    height: 18px;
    accent-color: rgba(150, 83, 14, 0.95);
    cursor: pointer;
}

.retro-register-locked {
    border: 1px dashed rgba(74, 53, 30, 0.22);
    background: rgba(255, 255, 255, 0.65);
    border-radius: 12px;
    padding: 12px 12px;
    color: rgba(59, 42, 22, 0.8);
    line-height: 1.6;
}

.retro-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.retro-download-panel h3 {
    margin-bottom: 10px;
}

.retro-download-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.retro-download-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 12px;
    border-radius: 12px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(74, 53, 30, 0.2);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.retro-download-card:hover {
    transform: translateY(-1px);
    border-color: rgba(122, 76, 24, 0.35);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.92);
}

.retro-download-card:active {
    transform: translateY(0);
}

.retro-download-card.is-wide {
    grid-column: 1 / -1;
}

.retro-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.retro-download-title {
    font-weight: 800;
    color: #3b2a16;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.retro-download-sub {
    font-size: 12px;
    color: rgba(59, 42, 22, 0.65);
}

.retro-download-tag {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 999px;
    color: #7a4c18;
    background: rgba(122, 76, 24, 0.12);
    border: 1px solid rgba(122, 76, 24, 0.18);
}

.retro-download-card.is-recommend .retro-download-tag {
    color: #ffffff;
    background: linear-gradient(180deg, rgba(207, 120, 31, 0.95), rgba(150, 83, 14, 0.95));
    border-color: rgba(150, 83, 14, 0.35);
}

.retro-download-hint {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(59, 42, 22, 0.7);
    line-height: 1.5;
}

.retro-panel .account label {
    display: block;
    margin: 0 0 10px 0;
}

.retro-panel .account label > span {
    display: inline-block;
    margin: 0 0 6px 0;
    font-weight: 700;
    color: rgba(59, 42, 22, 0.95);
}

.retro-panel .account input {
    width: 100%;
    height: 48px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(74, 53, 30, 0.25);
    outline: none;
    font-size: 16px;
}

.retro-panel .account input:focus {
    border-color: rgba(122, 76, 24, 0.55);
    box-shadow: 0 0 0 3px rgba(122, 76, 24, 0.16);
}

.retro-panel .button {
    width: 100%;
    border-radius: 12px;
}

.retro-panel .error-check,
.retro-panel .errors-register-form,
.retro-panel .errors-forgot-form,
.retro-panel .errors-pass2-form {
    margin-top: 8px;
    line-height: 1.5;
}

.retro-panel .wrapper-captcha {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.retro-panel .wrapper-captcha img {
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(74, 53, 30, 0.18);
}

.retro-panel #login {
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: 0;
}

.retro-panel #login input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(74, 53, 30, 0.25);
}

.retro-panel #login input::placeholder {
    color: rgba(59, 42, 22, 0.45);
}

.retro-panel #login input:focus {
    border-color: rgba(122, 76, 24, 0.55);
    box-shadow: 0 0 0 3px rgba(122, 76, 24, 0.16);
}

.retro-panel #login .login {
    width: 100%;
    height: 48px;
    border-radius: 12px;
}

.retro-panel #login .footer {
    margin-top: 10px;
}

.retro-panel #login .footer a {
    color: #7a4c18;
}

.retro-panel #login .footer a:hover {
    text-decoration: underline;
}

.retro-login-error {
    text-align: center;
    font-family: "BreeSerif", "Roboto", serif;
}

.retro-foot {
    padding: 12px 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.55);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 900px) {
    .retro-content {
        grid-template-columns: 1fr;
    }

    .retro-topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 14px;
    }

    .retro-nav {
        justify-content: flex-start;
    }

    .retro-content {
        padding: 14px;
    }

    .retro-download-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .retro-page {
        padding: 14px 10px;
        background-attachment: scroll;
    }

    .retro-shell {
        border-radius: 12px;
    }

    .retro-brand img {
        height: 40px;
    }

    .retro-download-grid {
        grid-template-columns: 1fr;
    }
}
