* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #222;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.shell {
    width: min(1180px, calc(100% - 28px));
    margin-inline: auto;
}

.header {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.header-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 30px;
    font-weight: 800;
}

.lab {
    padding: 5px 10px;
    background: #eee;
    border-radius: 999px;
    font-size: 12px;
}

.categories {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.nav {
    display: flex;
    gap: 8px;
    padding-block: 10px;
    overflow-x: auto;
}

.nav a {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: #f2f3f5;
    border-radius: 10px;
    font-size: 14px;
}

.nav small {
    opacity: .6;
}

.content {
    padding-block: 28px 50px;
}

.grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 15px;
}

.thumb {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e8e8e8;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 12px;
}

.card h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.player-box {
    padding: 12px;
    background: #111;
    border-radius: 16px;
}

#player {
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 10px;
}

#player ruffle-player {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.game-info {
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ddd;
}

.notice {
    padding: 15px;
    background: #fff3cd;
    border-radius: 10px;
}

.footer {
    padding: 25px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #ddd;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .shell {
        width: calc(100% - 20px);
    }

    .grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .card h2 {
        font-size: 14px;
    }
}

/* SUNARB_RECOVERY_V1 */

.recovery-note {
    padding: 14px 16px;
    border: 1px solid #e0e3e7;
    border-radius: 12px;
    background: #fff;
    line-height: 1.8;
}

.recovery-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.recovery-card {
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 15px;
    background: #fff;
}

.recovery-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    image-rendering: auto;
}

.recovery-body {
    padding: 15px;
}

.recovery-body h2 {
    margin-top: 0;
}

.recovery-body p {
    line-height: 1.6;
}

.recovery-hash {
    color: #777;
    font-family: monospace;
    direction: ltr;
    text-align: left;
}

.recovery-play {
    display: block;
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    background: #20242a;
    color: #fff;
    text-align: center;
}

.recovery-preview-image {
    width: 180px;
    max-width: 100%;
    margin: 0 0 18px auto;
    border-radius: 10px;
}

@media (max-width: 850px) {

    .recovery-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {

    .recovery-grid {
        grid-template-columns: 1fr;
    }
}


/* SUNARB_METADATA_EDITOR_V1 */

.metadata-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.metadata-summary > div {
    min-width: 140px;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
}

.metadata-summary strong {
    display: block;
    font-size: 24px;
}

.metadata-success {
    padding: 14px;
    margin: 15px 0;
    border-radius: 10px;
    background: #e9f8ed;
}

.metadata-error {
    padding: 14px;
    margin: 15px 0;
    border-radius: 10px;
    background: #ffe8e8;
}

.metadata-editor-grid {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.metadata-editor-card {
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
}

.metadata-visual {
    display: grid;
    grid-template-columns:
        220px minmax(0,1fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.metadata-visual img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.metadata-editor-card form {
    display: grid;
    gap: 14px;
}

.metadata-editor-card label {
    display: grid;
    gap: 7px;
    font-weight: 600;
}

.metadata-editor-card input,
.metadata-editor-card select,
.metadata-editor-card textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd3d8;
    border-radius: 9px;
    background: #fff;
    color: #222;
    font: inherit;
}

.metadata-editor-card textarea {
    resize: vertical;
    line-height: 1.7;
}

.metadata-save {
    border: 0;
    border-radius: 10px;
    padding: 13px 18px;
    cursor: pointer;
    background: #20242a;
    color: #fff;
    font: inherit;
    font-weight: 700;
}

@media (max-width: 650px) {

    .metadata-visual {
        grid-template-columns: 1fr;
    }

    .metadata-visual img {
        max-width: 300px;
    }
}


/* SUNARB_PUBLIC_V2 */

.public-header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #d8dde3;
    border-radius: 9px;
    background: #fff;
    color: #20242a;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.language-switch:hover {
    text-decoration: none;
}

html[dir="ltr"] .content,
html[dir="ltr"] .footer {
    text-align: left;
}

html[dir="ltr"] .nav {
    direction: ltr;
}

html[dir="ltr"] .header-inner {
    direction: ltr;
}

