
:root {
    color-scheme: dark;

    --nation-primary: #438fff;
    --nation-bright: #a7d1ff;
    --nation-deep: #06172f;
    --nation-glow: rgba(35, 113, 225, 0.22);

    --surface: rgba(8, 24, 48, 0.78);
    --surface-strong: rgba(5, 18, 38, 0.92);

    --border: rgba(130, 190, 255, 0.19);
    --border-hover: rgba(130, 190, 255, 0.48);

    --text-main: #eaf3ff;
    --text-muted: #a8bdd8;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--nation-deep);
    color: var(--text-main);
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

a {
    color: inherit;
}

::selection {
    background: rgba(67, 143, 255, 0.35);
    color: white;
}

/* FIXED BACKGROUND */

.nation-background {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;

    background:
        url("images/blue-background.png")
        center center / cover no-repeat;

    background-color: #06172f;
    transform: translateZ(0);
}

.background-shade {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            rgba(3, 13, 29, 0.43),
            rgba(3, 14, 31, 0.76) 45%,
            rgba(3, 12, 27, 0.92)
        );
}

/* HEADER */

.nation-header {
    position: sticky;
    top: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 16px clamp(18px, 5vw, 68px);

    background: rgba(4, 15, 32, 0.88);
    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.back-link,
.footer-link {
    color: var(--nation-bright);
    text-decoration: none;
    transition: color 0.2s ease;
}

.back-link:hover,
.footer-link:hover {
    color: white;
}

.back-link {
    font-family: Arial, sans-serif;
    font-size: 0.86rem;
}

.back-link span {
    margin-right: 6px;
}

.header-label {
    color: var(--text-muted);
    font-family: Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.17em;
    text-align: right;
}

/* MAIN LAYOUT */

.nation-page {
    width: min(1100px, calc(100% - 44px));
    margin: 0 auto;
    padding: 36px 0 70px;
}

/* HERO */

.nation-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    padding: clamp(50px, 8vw, 100px)
        clamp(22px, 6vw, 76px);

    margin-bottom: 54px;

    border: 1px solid var(--border);
    border-radius: 20px;

    background:
        linear-gradient(
            125deg,
            rgba(9, 39, 79, 0.86),
            rgba(5, 20, 43, 0.64)
        );

    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.2);
}

.nation-hero::after {
    content: "";
    position: absolute;
    z-index: -1;

    width: 320px;
    height: 320px;
    right: -90px;
    top: -150px;

    border-radius: 50%;
    background: var(--nation-glow);
    filter: blur(35px);
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 12px;

    color: var(--nation-bright);
    font-family: Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.19em;
    line-height: 1.5;
    text-transform: uppercase;
}

.nation-hero h1 {
    margin: 0;

    font-size: clamp(2.8rem, 8vw, 5.8rem);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.12;

    text-shadow: 0 0 35px rgba(67, 143, 255, 0.2);
}

.hero-subtitle {
    max-width: 650px;
    margin: 22px 0 0;

    color: #d0e5ff;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    line-height: 1.8;
}

.hero-divider {
    width: 86px;
    height: 2px;
    margin: 28px 0;

    background: var(--nation-primary);
    box-shadow: 0 0 18px var(--nation-primary);
}

.hero-note {
    max-width: 580px;
    margin: 0;

    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.8;
}

/* SECTIONS */

.nation-section {
    margin: 0 0 65px;
    scroll-margin-top: 90px;
}

.section-heading {
    max-width: 700px;
    margin-bottom: 25px;
}

.section-heading .eyebrow {
    margin-bottom: 10px;
}

.section-heading h2 {
    margin: 0;

    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 400;
    line-height: 1.3;
}

.section-intro {
    max-width: 650px;
    margin: 12px 0 0;

    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.8;
}

/* INFORMATION CARDS */

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

.info-card,
.magic-panel,
.alliance-panel,
.alliance-card,
.character-card {
    min-width: 0;

    border: 1px solid var(--border);
    background: var(--surface);

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14);

    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
}

.info-card {
    padding: 27px;
    border-radius: 3px;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.info-card:hover {
    border-color: var(--border-hover);
    background: rgba(10, 34, 66, 0.86);
    transform: translateY(-3px);
}

.card-label {
    display: block;
    margin-bottom: 9px;

    color: var(--nation-bright);
    font-family: Arial, sans-serif;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    line-height: 1.6;
    text-transform: uppercase;
}

.info-card h3 {
    margin: 0 0 12px;

    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.4;
}

.info-card p {
    margin: 0;

    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.9;
}

/* BLUE MAGIC */

.magic-panel {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    gap: 32px;

    padding: clamp(24px, 5vw, 42px);
    border-radius: 3px;

    background:
        linear-gradient(
            120deg,
            rgba(7, 39, 84, 0.88),
            rgba(4, 20, 43, 0.88)
        );
}

.magic-panel::after {
    content: "";
    position: absolute;
    top: -100px;
    right: -100px;

    width: 250px;
    height: 250px;
    border-radius: 50%;

    background: var(--nation-glow);
    filter: blur(45px);
    pointer-events: none;
}

.magic-orb {
    position: relative;
    flex: 0 0 clamp(90px, 17vw, 150px);

    width: clamp(90px, 17vw, 150px);
    aspect-ratio: 1;
    border-radius: 50%;

    background:
        radial-gradient(
            circle at 34% 30%,
            #c0e5ff 0%,
            #579fff 15%,
            #1461d5 38%,
            #092b70 65%,
            #05112d 85%
        );

    box-shadow:
        0 0 25px rgba(57, 145, 255, 0.32),
        0 0 65px rgba(25, 98, 230, 0.19),
        inset -10px -12px 25px rgba(0, 0, 25, 0.35);

    animation: blue-orb-glow 5s ease-in-out infinite;
}

.magic-content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.magic-content h3 {
    margin: 0 0 12px;

    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.4;
}

.magic-content p {
    margin: 0;

    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.9;
}

@keyframes blue-orb-glow {
    0%, 100% {
        box-shadow:
            0 0 25px rgba(57, 145, 255, 0.28),
            0 0 55px rgba(25, 98, 230, 0.16),
            inset -10px -12px 25px rgba(0, 0, 25, 0.35);
    }

    50% {
        box-shadow:
            0 0 35px rgba(57, 145, 255, 0.42),
            0 0 75px rgba(25, 98, 230, 0.24),
            inset -10px -12px 25px rgba(0, 0, 25, 0.35);
    }
}

/* ROYAL FAMILY — RESTORED CARD LAYOUT */

.character-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.character-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    border-radius: 4px;

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.character-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: rgba(8, 27, 54, 0.88);

    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.22),
        0 0 24px rgba(35, 113, 225, 0.07);
}

/* Portrait area */

.character-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 270px;
    overflow: hidden;

    background: rgba(3, 15, 34, 0.72);
    border-bottom: 1px solid var(--border);
}

/* SEALED / RESTRICTED PORTRAIT */

.character-art-empty {
    position: relative;
    isolation: isolate;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 270px;
    overflow: hidden;

    background:
        radial-gradient(
            circle at center,
            rgba(49, 117, 206, 0.22),
            transparent 52%
        ),
        repeating-linear-gradient(
            135deg,
            rgba(120, 177, 255, 0.035) 0px,
            rgba(120, 177, 255, 0.035) 2px,
            transparent 2px,
            transparent 12px
        ),
        linear-gradient(
            145deg,
            #0b2850,
            #061329 72%
        );

    border: 1px solid rgba(111, 169, 245, 0.25);
}

/* Inner sealed emblem */

.character-art-empty::before {
    content: "✧";

    position: absolute;
    z-index: 1;
    left: 50%;
    top: 44%;

    transform: translate(-50%, -50%);

    width: 86px;
    height: 86px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(137, 190, 255, 0.42);
    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(49, 117, 206, 0.2),
            rgba(3, 15, 34, 0.88)
        );

    color: #8bbdff;
    font-size: 42px;
    text-shadow: 0 0 18px rgba(74, 145, 255, 0.65);

    box-shadow:
        0 0 25px rgba(35, 113, 225, 0.12),
        inset 0 0 18px rgba(70, 139, 231, 0.12);

    pointer-events: none;
}

/* SEALED RECORD label */

.character-art-empty span {
    position: absolute;
    z-index: 2;

    left: 50%;
    bottom: 19px;
    transform: translateX(-50%);

    width: max-content;
    max-width: 90%;
    padding: 6px 12px;

    color: #a8cfff;
    background: rgba(3, 13, 29, 0.88);
    border: 1px solid rgba(111, 169, 245, 0.32);
    border-radius: 3px;

    font-family: Arial, sans-serif;
    font-size: 0;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    white-space: nowrap;
}

.character-art-empty span::after {
    content: "SEALED RECORD";
    font-size: 9px;
}

/* Character information below the portrait */

.character-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    flex: 1;
    min-width: 0;
    padding: 22px;
}

.character-details .card-label {
    margin-bottom: 8px;
}

.character-details h3 {
    margin: 0 0 7px;

    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.45;

    overflow-wrap: anywhere;
}

.character-details p {
    margin: 0;

    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.8;
}

/* Restricted profile label */

.locked-label {
    display: inline-block;
    margin-top: 14px;
    padding: 5px 9px;

    color: #9bc5ff;
    background: rgba(25, 69, 124, 0.2);
    border: 1px solid rgba(111, 169, 245, 0.28);
    border-radius: 3px;

    font-family: Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    line-height: 1.6;
    text-transform: uppercase;
}

/* Hover effects only affect the portrait inside the card */

.character-card:hover .character-art-empty {
    border-color: rgba(137, 190, 255, 0.55);

    box-shadow:
        inset 0 0 25px rgba(35, 113, 225, 0.12),
        0 0 18px rgba(35, 113, 225, 0.05);
}

.character-card:hover .character-art-empty::before {
    box-shadow:
        0 0 30px rgba(35, 113, 225, 0.28),
        inset 0 0 18px rgba(70, 139, 231, 0.18);
}

@media (prefers-reduced-motion: no-preference) {
    .character-art-empty::before {
        transition: box-shadow 0.3s ease;
    }
}

/* ALLIANCES */

.alliance-panel {
    padding: clamp(22px, 4vw, 34px);
    border-radius: 3px;
}

.alliance-panel > p {
    margin: 0 0 23px;

    color: var(--text-muted);
    font-size: 0.94rem;
}

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

.alliance-card {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 19px;
    border-radius: 3px;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

a.alliance-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    background: rgba(14, 44, 83, 0.9);
}

.alliance-card:focus-visible,
.back-link:focus-visible,
.footer-link:focus-visible {
    outline: 2px solid var(--nation-bright);
    outline-offset: 4px;
}

.alliance-symbol {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border: 1px solid var(--border);
    border-radius: 50%;

    color: var(--nation-bright);
    font-size: 1.35rem;
}

.alliance-card > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.alliance-card .card-label {
    margin-bottom: 4px;
}

.alliance-card strong {
    display: block;

    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
}

.alliance-card small {
    display: block;
    margin-top: 5px;

    color: var(--text-muted);
    font-family: Arial, sans-serif;
    font-size: 0.69rem;
    line-height: 1.6;
}

.alliance-arrow {
    flex-shrink: 0;
    color: var(--nation-bright);
    font-size: 1.1rem;
}

.alliance-unlinked {
    cursor: default;
}

/* FOOTER */

.nation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;

    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.nation-footer p {
    margin: 0;

    color: var(--text-muted);
    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.13em;
    line-height: 1.7;
}

.footer-link {
    font-family: Arial, sans-serif;
    font-size: 0.82rem;
}

/* TABLET */

@media (max-width: 800px) {
    .nation-page {
        width: min(calc(100% - 32px), 680px);
        padding-top: 25px;
    }

    .nation-hero {
        margin-bottom: 45px;
    }

    .nation-section {
        margin-bottom: 52px;
    }

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

    .character-art,
    .character-art-empty {
        min-height: 250px;
    }

    .magic-panel {
        gap: 25px;
    }
}

/* MOBILE */

@media (max-width: 560px) {
    html {
        scroll-padding-top: 80px;
    }

    .nation-header {
        padding: 13px 14px;
        gap: 10px;
    }

    .back-link {
        font-size: 0.73rem;
        line-height: 1.6;
    }

    .header-label {
        font-size: 0.51rem;
        letter-spacing: 0.08em;
        line-height: 1.6;
    }

    .nation-page {
        width: calc(100% - 28px);
        padding-top: 18px;
        padding-bottom: 45px;
    }

    .nation-hero {
        padding: 62px 22px;
        margin-bottom: 42px;
        border-radius: 12px;
    }

    .nation-hero h1 {
        font-size: clamp(2.6rem, 11vw, 4rem);
        overflow-wrap: anywhere;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero-note {
        font-size: 0.86rem;
    }

    .nation-section {
        margin-bottom: 45px;
        scroll-margin-top: 80px;
    }

    .section-heading {
        margin-bottom: 22px;
    }

    .section-heading h2 {
        font-size: 1.85rem;
    }

    .info-grid,
    .character-grid,
    .alliance-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 22px;
    }

    .magic-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 23px;
        padding: 24px;
    }

    .magic-orb {
        flex-basis: auto;
        width: 90px;
    }

    .character-grid {
        gap: 17px;
    }

    .character-art,
    .character-art-empty {
        min-height: 300px;
    }

    .character-details {
        padding: 21px;
    }

    .alliance-panel {
        padding: 20px;
    }

    .alliance-card {
        padding: 16px;
    }

    .nation-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

/* SMALL MOBILE */

@media (max-width: 360px) {
    .nation-header {
        align-items: flex-start;
    }

    .back-link {
        max-width: 68%;
    }

    .header-label {
        max-width: 32%;
        text-align: right;
    }

    .nation-page {
        width: calc(100% - 22px);
    }

    .nation-hero {
        padding: 48px 17px;
    }

    .nation-hero h1 {
        font-size: 2.45rem;
    }

    .info-card,
    .character-details {
        padding: 19px;
    }

    .character-art,
    .character-art-empty {
        min-height: 260px;
    }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.character-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.character-card-link article {
    height: 100%;
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease;
}

.character-card-link:hover article {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.28);
}

.character-card-link:focus-visible {
    outline: 2px solid rgba(220, 220, 255, 0.85);
    outline-offset: 4px;
    border-radius: 8px;
}
