@font-face {
    font-family: "Pixel Digivolve";
    src: url("../../Font/pixel-digivolve-font/PixelDigivolve-mOm9.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Pixel Digivolve";
    src: url("../../Font/pixel-digivolve-font/PixelDigivolveItalic-dV8R.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --bg-dark: #081833;
    --bg-mid: #10376a;
    --bg-light: #1a5ba4;
    --screen-base: #d7ecff;
    --screen-border: #1f4d88;
    --ink: #0d2643;
    --panel-shadow: #14345c;
    --cartridge-a: #2a6ec4;
    --cartridge-b: #184684;
    --cartridge-active-a: #ffbe4e;
    --cartridge-active-b: #d9771f;
    --danger-pixel: #f36f2f;
    --text-primary: #0e2a4e;
    --text-muted: #183d67;
    --ro-sky-a: #cde7ff;
    --ro-sky-b: #eaf5ff;
    --ro-field-a: #d5e9ff;
    --ro-field-b: #bdd8f5;
    --accent-energy: #ffd968;
    --accent-ice: #9ed4ff;
    --pixel-font: "Pixel Digivolve", "VT323", cursive;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 16%, rgba(158, 212, 255, 0.36) 0%, rgba(158, 212, 255, 0) 28%),
        radial-gradient(circle at 82% 10%, rgba(255, 217, 104, 0.24) 0%, rgba(255, 217, 104, 0) 30%),
        linear-gradient(180deg, #0a1b3a 0%, #0c2851 44%, #0f3466 72%, #164a84 100%),
        repeating-linear-gradient(
            90deg,
            rgba(138, 185, 255, 0.08) 0,
            rgba(138, 185, 255, 0.08) 1px,
            transparent 1px,
            transparent 24px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(138, 185, 255, 0.06) 0,
            rgba(138, 185, 255, 0.06) 1px,
            transparent 1px,
            transparent 24px
        );
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

body::before,
body::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background:
        linear-gradient(90deg, rgba(255, 217, 104, 0.35) 0 2px, transparent 2px 100%) 0 0 / 180px 180px repeat,
        linear-gradient(0deg, rgba(255, 217, 104, 0.24) 0 2px, transparent 2px 100%) 0 0 / 180px 180px repeat,
        radial-gradient(circle at 0 0, rgba(255, 217, 104, 0.42) 0 2px, transparent 2px 100%) 0 0 / 180px 180px repeat;
    opacity: 0.28;
}

body::after {
    background:
        radial-gradient(circle at 20% 24%, rgba(158, 212, 255, 0.22) 0 11%, transparent 12% 100%),
        radial-gradient(circle at 78% 70%, rgba(255, 217, 104, 0.24) 0 13%, transparent 14% 100%);
    opacity: 0.95;
}

.console-wrap {
    position: relative;
    z-index: 1;
}

.console-wrap {
    width: min(1580px, 100%);
    background:
        linear-gradient(180deg, #235ea7 0%, #1b4a88 48%, #14376d 100%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0, rgba(255, 255, 255, 0.09) 2px, transparent 2px, transparent 10px);
    border: 4px solid #0f2d57;
    box-shadow:
        0 0 0 4px #2c6bb7,
        0 0 0 8px #0d2649,
        0 26px 48px rgba(2, 12, 27, 0.65);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.console-wrap::before,
.console-wrap::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.console-wrap::before {
    top: -40px;
    right: -40px;
}

.console-wrap::after {
    bottom: -55px;
    left: -55px;
}

.hero-screen {
    background:
        linear-gradient(180deg, #f2f9ff 0%, #d6eaff 100%),
        repeating-linear-gradient(90deg, rgba(54, 101, 160, 0.08) 0, rgba(54, 101, 160, 0.08) 2px, transparent 2px, transparent 8px);
    border: 5px solid var(--screen-border);
    box-shadow:
        inset 0 0 0 3px #7ca8dc,
        inset 0 8px 0 rgba(255, 255, 255, 0.35),
        0 8px 0 var(--panel-shadow),
        0 0 0 1px rgba(255, 217, 104, 0.42);
    padding: 22px 20px 18px;
    border-radius: 8px;
    animation: bootUp 900ms steps(6) both;
}

.meta-playground {
    border: 3px solid #2d5d98;
    background:
        linear-gradient(180deg, #e0efff 0%, #f4f9ff 52%, #d2e6ff 52%, #a8c9f0 100%),
        repeating-linear-gradient(90deg, rgba(72, 117, 176, 0.13) 0, rgba(72, 117, 176, 0.13) 1px, transparent 1px, transparent 16px),
        repeating-linear-gradient(
            0deg,
            rgba(52, 94, 142, 0.14) 0,
            rgba(52, 94, 142, 0.14) 2px,
            transparent 2px,
            transparent 8px
        );
    border-radius: 6px;
    box-shadow:
        inset 0 0 0 2px #92b5df,
        inset 0 10px 0 rgba(255, 255, 255, 0.42);
    min-height: 220px;
    position: relative;
    overflow: hidden;
}

.meta-hud {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--pixel-font);
    font-size: 11px;
    text-transform: uppercase;
    padding: 10px;
    border-bottom: 2px dashed #4f7db6;
    position: relative;
    z-index: 2;
    background: rgba(217, 233, 252, 0.86);
}

.slime-layer {
    position: absolute;
    inset: 36px 0 0;
}

.ro-char {
    position: absolute;
    width: var(--char-size, 38px);
    height: calc(var(--char-size, 38px) * 1.08);
    transform-origin: center bottom;
    transition: transform 110ms steps(2), filter 110ms linear;
    pointer-events: auto;
}

.ro-hp {
    position: absolute;
    left: 8%;
    bottom: -8px;
    width: 84%;
    height: 6px;
    border: 1px solid #2f4163;
    background: rgba(30, 48, 78, 0.32);
}

.ro-hp-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #5f98df 0%, #8fc2ff 100%);
}

.ro-shadow {
    position: absolute;
    width: 68%;
    height: 8px;
    left: 16%;
    bottom: 3px;
    border-radius: 50%;
    background: rgba(20, 33, 12, 0.35);
    filter: blur(0.4px);
}

.ro-sprite {
    position: absolute;
    left: 50%;
    bottom: 6px;
    width: 76%;
    height: 90%;
    transform: translateX(-50%);
}

.ro-idle-sheet {
    position: absolute;
    left: 50%;
    bottom: -3%;
    width: 132%;
    height: 114%;
    transform: translateX(-50%);
    image-rendering: auto;
    filter: drop-shadow(0 2px 0 rgba(26, 42, 65, 0.34));
    display: block;
    background-image: url("../../images/evol1-removebg-preview.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: 50% 100%;
}

.ro-fight-sheet {
    position: absolute;
    left: 50%;
    bottom: -4%;
    width: 132%;
    height: 98%;
    transform: translateX(-50%);
    image-rendering: auto;
    filter: drop-shadow(0 1px 0 rgba(26, 42, 65, 0.2));
    display: block;
    opacity: 0;
    pointer-events: none;
}

.ro-idle-sheet::before {
    display: none;
}

.ro-idle-sheet::after {
    display: none;
}

.ro-char.stage-0 .ro-idle-sheet {
    width: 106%;
    height: 98%;
    background-image: url("../../images/evol1-removebg-preview.png");
}

.ro-char.stage-1 .ro-idle-sheet {
    width: 118%;
    height: 106%;
    background-image: url("../../images/evol2-removebg-preview.png");
}

.ro-char.stage-2 .ro-idle-sheet {
    width: 138%;
    height: 118%;
    background-image: url("../../images/evol3-removebg-preview.png");
}

.ro-char.stage-3 .ro-idle-sheet {
    width: 158%;
    height: 130%;
    background-image: url("../../images/evol4-removebg-preview.png");
}

.ro-char.is-cast .ro-idle-sheet {
    filter: brightness(1.08) drop-shadow(0 0 6px rgba(125, 182, 255, 0.75));
}

.ro-char.is-cast .ro-fight-sheet {
    opacity: 0.95;
    animation: monster-cast-pulse 180ms steps(2) infinite;
}

@keyframes monster-cast-pulse {
    0% {
        transform: translateX(-50%) scale(1);
        filter: drop-shadow(0 1px 0 rgba(26, 42, 65, 0.2));
    }
    100% {
        transform: translateX(-50%) scale(1.03);
        filter: drop-shadow(0 0 7px rgba(120, 173, 255, 0.75));
    }
}

.tamagotchi-pet {
    pointer-events: none;
}

.tama-status-trigger {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    border: 1px solid #4d6f98;
    background: linear-gradient(180deg, #d8e9ff 0%, #9dbfe3 100%);
    color: #18395f;
    font-family: var(--pixel-font);
    font-size: 8px;
    padding: 5px 8px;
    cursor: pointer;
    box-shadow: 0 1px 0 #44648b;
}

.tama-panel {
    position: absolute;
    top: 12px;
    left: 8px;
    width: min(332px, calc(100% - 16px));
    border: 2px solid #4b698f;
    background: rgba(218, 233, 250, 0.92);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.38);
    padding: 6px;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    grid-template-areas:
        "head head"
        "status controls"
        "bars controls";
    column-gap: 8px;
    row-gap: 4px;
    align-items: start;
}

.tama-panel.is-hidden {
    display: none;
}

.tama-panel-head {
    grid-area: head;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.tama-panel-title {
    font-family: var(--pixel-font);
    font-size: 9px;
    color: #19304e;
}

.tama-close {
    border: 1px solid #4d6f98;
    background: linear-gradient(180deg, #f7dfe2 0%, #dca3ad 100%);
    color: #5f1c29;
    font-family: var(--pixel-font);
    font-size: 8px;
    padding: 2px 5px;
    cursor: pointer;
}

.tama-status-trigger:hover,
.tama-status-trigger:focus-visible,
.tama-close:hover,
.tama-close:focus-visible {
    filter: brightness(1.05);
    outline: none;
}

.tama-status {
    grid-area: status;
    font-family: var(--pixel-font);
    font-size: 9px;
    color: #19304e;
    margin-bottom: 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tama-bars {
    grid-area: bars;
    display: grid;
    gap: 4px;
}

.tama-row {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 6px;
}

.tama-label {
    font-family: var(--pixel-font);
    font-size: 8px;
    color: #27486f;
}

.tama-bar {
    height: 7px;
    border: 1px solid #3d5d84;
    background: rgba(27, 52, 82, 0.28);
    overflow: hidden;
}

.tama-fill {
    display: block;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, #66a3e8 0%, #9bd0ff 100%);
}

.tama-controls {
    grid-area: controls;
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.tama-btn {
    border: 1px solid #4d6f98;
    background: linear-gradient(180deg, #d8e9ff 0%, #9dbfe3 100%);
    color: #18395f;
    font-family: var(--pixel-font);
    font-size: 8px;
    padding: 4px 2px;
    cursor: pointer;
    box-shadow: 0 1px 0 #44648b;
}

.tama-btn:hover,
.tama-btn:focus-visible {
    filter: brightness(1.05);
    transform: translateY(-1px);
    outline: none;
}

.ro-head {
    position: absolute;
    width: 48%;
    height: 34%;
    left: 26%;
    top: 2%;
    border: 2px solid #2f3324;
    border-radius: 2px;
    background: linear-gradient(180deg, #ffe8cd 0%, #efcfa6 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38);
}

.ro-hair {
    position: absolute;
    width: 58%;
    height: 22%;
    left: 21%;
    top: 0;
    border: 2px solid #2f3324;
    border-bottom: 0;
    background: linear-gradient(180deg, #54403f 0%, #3a2a2b 100%);
}

.ro-hair::before,
.ro-hair::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 6px;
    top: calc(100% - 1px);
    background: inherit;
    border: 2px solid #2f3324;
    border-top: 0;
}

.ro-hair::before {
    left: -2px;
}

.ro-hair::after {
    right: -2px;
}

.ro-face {
    position: absolute;
    inset: 0;
}

.ro-face::before,
.ro-face::after {
    content: "";
    position: absolute;
    top: 46%;
    width: 4px;
    height: 4px;
    background: #1f2731;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.ro-face::before {
    left: 26%;
}

.ro-face::after {
    right: 26%;
}

.ro-torso {
    position: absolute;
    width: 58%;
    height: 44%;
    left: 21%;
    top: 38%;
    border: 2px solid #2f3324;
    background: var(--char-cloth, #6e8bc7);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset -3px -3px 0 rgba(20, 30, 45, 0.18);
}

.ro-torso::before,
.ro-torso::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 9px;
    bottom: -11px;
    border: 2px solid #2f3324;
    background: #544f64;
}

.ro-torso::before {
    left: 2px;
}

.ro-torso::after {
    right: 2px;
}

.ro-weapon {
    position: absolute;
    width: 7px;
    height: 40%;
    right: 8%;
    top: 40%;
    border: 2px solid #3a3a31;
    background: linear-gradient(180deg, #eff5ff 0%, #a0b8d9 100%);
}

.ro-shield {
    position: absolute;
    width: 11px;
    height: 16px;
    left: 6%;
    top: 46%;
    border: 2px solid #31372a;
    border-radius: 3px;
    background: linear-gradient(180deg, #d9e5f4 0%, #8ea4bf 100%);
    display: none;
}

.ro-char.role-sword .ro-weapon {
    width: 7px;
    height: 48%;
    right: 5%;
    top: 34%;
    background: linear-gradient(180deg, #f7fbff 0%, #a9bfd9 100%);
}

.ro-char.role-sword .ro-shield {
    display: block;
}

.ro-char.role-sword .ro-hair {
    background: linear-gradient(180deg, #46639f 0%, #2d406f 100%);
}

.ro-char.role-healer .ro-weapon {
    width: 5px;
    right: 10%;
    top: 34%;
    background: linear-gradient(180deg, #f5efdd 0%, #b79a67 100%);
}

.ro-char.role-healer .ro-hair {
    background: linear-gradient(180deg, #90c6a5 0%, #5d8f73 100%);
}

.ro-char.role-healer .ro-torso {
    background: linear-gradient(180deg, #9acbb0 0%, #6b9d82 100%);
}

.ro-char.role-mage .ro-weapon {
    width: 5px;
    right: 12%;
    top: 34%;
    background: linear-gradient(180deg, #f3ecff 0%, #9f85cf 100%);
}

.ro-char.role-mage .ro-hair {
    background: linear-gradient(180deg, #b4a4e3 0%, #7f6ab3 100%);
}

.ro-char.role-mage .ro-torso {
    background: linear-gradient(180deg, #8e79ca 0%, #6f58b0 100%);
}

.ro-char.role-archer .ro-weapon {
    width: 9px;
    right: 4%;
    top: 44%;
    border-radius: 8px;
    background: linear-gradient(180deg, #ead6b6 0%, #9f6d42 100%);
}

.ro-char.role-archer .ro-hair {
    background: linear-gradient(180deg, #d6a170 0%, #9f6c45 100%);
}

.ro-char.role-archer .ro-torso {
    background: linear-gradient(180deg, #cb915f 0%, #a36b3f 100%);
}

.ro-name {
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--pixel-font);
    font-size: 8px;
    color: #1a2d18;
    background: rgba(244, 251, 227, 0.86);
    border: 1px solid rgba(58, 85, 45, 0.6);
    padding: 2px 3px;
    white-space: nowrap;
}

.ro-emote {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--pixel-font);
    font-size: 11px;
    color: #203014;
    opacity: 0;
    transition: opacity 120ms linear;
}

.ro-char:hover,
.ro-char.is-alert {
    filter: brightness(1.08) saturate(1.05);
}

.ro-char.is-bop {
    animation: slimeBop 220ms steps(2);
}

.ro-char.is-cast .ro-sprite {
    animation: castPulse 360ms steps(3);
}

.ro-char.role-sword.is-cast .ro-weapon {
    animation: swordSlash 260ms steps(2);
    transform-origin: bottom center;
}

.ro-char.use-idle-sheet.role-sword.is-cast .ro-idle-sheet {
    animation: none;
}

.ro-char.use-idle-sheet.role-sword.is-cast .ro-fight-sheet {
    animation: fightSwordFrames 260ms linear;
}

.ro-char.role-archer.is-cast .ro-weapon {
    animation: bowDraw 320ms steps(2);
    transform-origin: left center;
}

.ro-char.use-idle-sheet.role-archer.is-cast .ro-idle-sheet {
    animation: none;
}

.ro-char.use-idle-sheet.role-archer.is-cast .ro-fight-sheet {
    animation: fightArcherFrames 320ms linear;
}

.ro-char.role-mage.is-cast .ro-weapon {
    animation: staffCast 360ms steps(3);
    box-shadow: 0 0 8px rgba(185, 164, 255, 0.9);
}

.ro-char.use-idle-sheet.role-mage.is-cast .ro-idle-sheet {
    animation: none;
}

.ro-char.use-idle-sheet.role-mage.is-cast .ro-fight-sheet {
    animation: fightMageFrames 360ms linear;
    filter: drop-shadow(0 0 8px rgba(185, 164, 255, 0.9));
}

.ro-char.use-idle-sheet.role-healer.is-cast .ro-fight-sheet {
    animation: fightHealerFrames 360ms linear;
}

.ro-char.role-healer.is-cast::after,
.ro-char.role-mage.is-cast::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: calc(50% - 7px);
    top: 10px;
    border: 2px solid rgba(248, 255, 230, 0.95);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(245, 255, 220, 0.75);
    animation: supportAura 360ms ease-out;
    pointer-events: none;
}

.ro-char.role-healer.is-cast::after {
    border-color: rgba(220, 255, 222, 0.98);
    box-shadow: 0 0 10px rgba(180, 255, 196, 0.9);
}

.ro-char.is-cast .ro-emote,
.ro-char.is-alert .ro-emote {
    opacity: 1;
}

.ro-char.is-hurt .ro-sprite {
    filter: brightness(0.9) saturate(0.85);
}

.ro-char.use-idle-sheet.is-hurt .ro-idle-sheet {
    filter: brightness(0.9) saturate(0.82) drop-shadow(0 2px 0 rgba(26, 42, 65, 0.34));
}

.ro-dummy {
    position: absolute;
    width: 52px;
    height: 44px;
    border: 2px solid #643f66;
    border-radius: 45% 45% 38% 38%;
    background: linear-gradient(180deg, #ffc0ea 0%, #ef84cd 68%, #d86db4 100%);
    box-shadow:
        inset -5px -4px 0 rgba(114, 43, 93, 0.2),
        inset 5px 5px 0 rgba(255, 242, 252, 0.35);
    transform-origin: center bottom;
}

.ro-dummy::before {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    left: 16px;
    top: 17px;
    background: #3f2640;
    box-shadow: 13px 0 0 #3f2640;
}

.ro-dummy::after {
    content: "";
    position: absolute;
    width: 72px;
    height: 8px;
    left: -10px;
    bottom: -8px;
    border-radius: 50%;
    background: rgba(20, 33, 12, 0.38);
}

.ro-dummy-name {
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--pixel-font);
    font-size: 8px;
    color: #4e2f4f;
    background: rgba(248, 252, 230, 0.9);
    border: 1px solid rgba(58, 85, 45, 0.64);
    padding: 2px 3px;
    white-space: nowrap;
}

.ro-dummy-hp {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: -16px;
    height: 7px;
    border: 1px solid #2f3324;
    background: rgba(20, 30, 16, 0.38);
}

.ro-dummy-hp-fill {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #cc7db3 0%, #ef9ad2 100%);
}

.ro-dummy.is-hit {
    animation: dummyHit 180ms steps(2);
}

.ro-dummy.is-defeated {
    filter: grayscale(0.75) brightness(0.8);
}

.ro-damage {
    position: absolute;
    font-family: var(--pixel-font);
    font-size: 10px;
    color: #7f1f14;
    text-shadow: 1px 1px 0 rgba(255, 240, 220, 0.85);
    pointer-events: none;
    animation: damagePop 620ms ease-out forwards;
}

.boot-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--pixel-font);
    font-size: 12px;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.pixel-title {
    font-family: var(--pixel-font);
    line-height: 1.6;
    margin: 0;
    font-size: clamp(17px, 2.4vw, 26px);
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #6f8456;
}

.hero-note {
    margin: 14px 0 0;
    font-size: clamp(24px, 3.3vw, 32px);
    line-height: 1.1;
}

.tab-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    margin: 18px 0 16px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.page-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.panel-stack {
    min-width: 0;
}

.top-right-stack {
    display: grid;
    gap: 12px;
}

.top-right-stack {
    order: 1;
}

.panel-stack {
    order: 2;
}

.hero-right {
    padding: 12px;
}

.hero-right .meta-playground {
    min-height: 210px;
}

.profile-dock {
    background: linear-gradient(180deg, #e3f1ff 0%, #ccdef5 100%);
    border: 4px solid #2b5c96;
    box-shadow:
        inset 0 0 0 3px #96bbe3,
        0 8px 0 #1e4675;
    border-radius: 8px;
    padding: 10px;
}

.panel-head-small {
    font-size: 13px;
    margin-bottom: 8px;
}

.dock-body .pixel-card {
    margin: 0;
}

.dock-chip-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.dock-chip-row .badge {
    font-size: 13px;
    padding: 6px 10px;
}

.dock-body {
    display: grid;
    gap: 10px;
}

.dock-links {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.dock-body .pixel-card h3 {
    font-size: 13px;
    line-height: 1.5;
}

.dock-body .pixel-card p,
.dock-body .pixel-card li {
    font-size: 19px;
    line-height: 1.6;
}

.social-link {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #2b5b95;
    background: linear-gradient(180deg, #fff0c8 0%, #ffc768 100%);
    color: #643707;
    font-family: var(--pixel-font);
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 2px 0 #a85d12;
}

.social-link:hover,
.social-link:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.05);
    outline: none;
}

.pak-tab {
    border: 3px solid #1d4a81;
    background: linear-gradient(180deg, var(--cartridge-a), var(--cartridge-b));
    font-family: var(--pixel-font);
    font-size: 13px;
    color: #ebf5ff;
    padding: 16px 10px 12px;
    min-height: 84px;
    cursor: pointer;
    position: relative;
    text-transform: uppercase;
    transition: transform 130ms steps(2), filter 130ms linear;
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.2),
        0 4px 0 #12305a;
    clip-path: polygon(0 0, 100% 0, 100% 84%, 86% 84%, 86% 100%, 14% 100%, 14% 84%, 0 84%);
}

.pak-tab::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 10px;
    right: 10px;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        #6fb2ff 0,
        #6fb2ff 8px,
        #9ad0ff 8px,
        #9ad0ff 12px
    );
    opacity: 0.85;
}

.pak-tab:hover,
.pak-tab:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.04);
    outline: none;
}

.pak-tab.active {
    background: linear-gradient(180deg, var(--cartridge-active-a), var(--cartridge-active-b));
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.32),
        0 2px 0 #8a4d12;
    color: #4f2804;
    transform: translateY(2px);
}

.panel {
    background: linear-gradient(180deg, #eaf4ff 0%, #d5e8fb 100%);
    border: 4px solid #2b5a93;
    box-shadow:
        inset 0 0 0 3px #a6c5e7,
        0 8px 0 #1e4675;
    border-radius: 8px;
    min-height: 520px;
    padding: 18px;
    display: none;
    opacity: 0;
    transform: translateY(8px);
    animation: panelIn 240ms steps(6) forwards;
}

.panel.active {
    display: block;
}

#home.panel {
    min-height: 650px;
}

#home .home-preview-card {
    padding: 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 3px dashed #4f7eb7;
    padding-bottom: 10px;
    margin-bottom: 14px;
    font-family: var(--pixel-font);
    font-size: 13px;
    letter-spacing: 0.6px;
    color: #173f6d;
    text-transform: uppercase;
}

.panel-head > span:first-child {
    padding-bottom: 2px;
    border-bottom: 2px solid rgba(35, 86, 138, 0.34);
}

.badge {
    font-size: 12px;
    padding: 5px 7px;
    border: 2px solid #29578f;
    background: linear-gradient(180deg, #fff3cf 0%, #ffd381 100%);
    color: #5d3409;
}

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

.profile-sections {
    display: grid;
    gap: 14px;
}

.profile-tab-block {
    padding: 14px;
}

.profile-tab-block ul {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 8px;
}

.profile-item-title {
    display: block;
}

.profile-item-title-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-item-link {
    color: #20385a;
    text-decoration: none;
}

.profile-item-link:hover,
.profile-item-link:focus-visible {
    color: #2e5484;
    outline: none;
}

.profile-item-note {
    display: block;
    opacity: 1;
    font-size: 18px;
    color: #305783;
}

.profile-empty {
    opacity: 0.8;
}

.pixel-card {
    border: 3px solid #4d78a9;
    background:
        linear-gradient(180deg, #eef6ff 0%, #d8e9fb 100%),
        repeating-linear-gradient(90deg, rgba(89, 133, 185, 0.06) 0, rgba(89, 133, 185, 0.06) 1px, transparent 1px, transparent 7px);
    box-shadow:
        inset 0 3px 0 rgba(255, 255, 255, 0.5),
        0 2px 0 rgba(44, 85, 132, 0.3);
    padding: 14px;
}

.pixel-card h3 {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(52, 99, 151, 0.35);
    font-family: var(--pixel-font);
    font-size: 13px;
    line-height: 1.45;
    color: #143c67;
}

.pixel-card p,
.pixel-card li {
    margin: 0;
    font-size: 19px;
    line-height: 1.65;
    color: var(--text-muted);
}

.pixel-card ul {
    margin: 0;
    padding-left: 22px;
}

.pixel-card ul li {
    background: #f9fcff;
    border: 1px solid #a4bfdc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    padding: 6px 8px;
}

.pixel-card strong,
.home-preview-card strong {
    font-weight: 700;
}

.content-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border: 2px solid #3f689b;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25);
    image-rendering: pixelated;
    background: #d7e8fb;
}

.card-image {
    height: 210px;
    margin-bottom: 10px;
}

.publication-image {
    width: 100%;
    height: 100%;
    margin-bottom: 0;
}

.publication-card {
    padding: 10px;
}

.publication-body {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 12px;
    align-items: stretch;
}

.publication-body.no-thumb {
    grid-template-columns: 1fr;
}

.publication-thumb-frame {
    width: 100%;
    min-height: 130px;
    aspect-ratio: 16 / 10;
    border: 2px solid #4f7198;
    background: linear-gradient(180deg, #d5e5f8 0%, #aac5e6 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.publication-content {
    display: grid;
    align-content: start;
    gap: 8px;
}

.entry-secondary {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: 0;
    opacity: 1;
    color: var(--text-muted);
}

.publication-title-link {
    color: #20385a;
    text-decoration: none;
    line-height: 1.9;
}

.publication-content p {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.65;
    letter-spacing: 0;
    color: var(--text-muted);
}

.publication-title-link:hover,
.publication-title-link:focus-visible {
    color: #2e5484;
    outline: none;
}

.home-preview-image {
    width: 42px;
    height: 42px;
    margin-right: 8px;
    flex-shrink: 0;
}

.home-line-row {
    display: inline-flex;
    align-items: center;
}

.home-preview-entry {
    display: grid;
    gap: 3px;
}

.home-preview-title-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 8px;
    row-gap: 4px;
    color: #133e6d;
}

.home-preview-date {
    display: inline-block;
    min-width: 0;
    width: 90px;
    font-family: var(--pixel-font);
    font-size: 11px;
    color: #274f7e;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.home-preview-main-title {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.home-preview-detail {
    display: block;
    opacity: 1;
    font-size: 18px;
    line-height: 1.55;
    color: #2a527f;
}

.home-preview-card {
    display: grid;
    gap: 10px;
}

.home-preview-card.home-preview-publications h3,
.home-preview-card.home-preview-news h3 {
    border-bottom: 2px solid rgba(45, 94, 146, 0.42);
}

.home-preview-card.home-preview-publications ul,
.home-preview-card.home-preview-news ul {
    display: grid;
    gap: 8px;
}

.home-preview-card.home-preview-publications li,
.home-preview-card.home-preview-news li {
    border-left: 4px solid #4f79ad;
    background: linear-gradient(180deg, #f7fbff 0%, #e6f0fb 100%);
    padding: 8px 10px;
}

.home-preview-card.home-preview-publications .home-preview-title-row,
.home-preview-card.home-preview-news .home-preview-title-row {
    width: 100%;
    padding-bottom: 6px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(60, 105, 154, 0.42);
}

.home-preview-card.home-preview-news li {
    border-left-color: #e0942c;
}

.home-preview-card.home-preview-wide {
    grid-column: 1 / -1;
}

.preview-jump {
    justify-self: start;
    border: 2px solid #235083;
    background: linear-gradient(180deg, #ffe7a9 0%, #ffb24f 100%);
    color: #64370b;
    font-family: var(--pixel-font);
    font-size: 10px;
    text-transform: uppercase;
    padding: 7px 10px;
    cursor: pointer;
    box-shadow: 0 2px 0 #a25f13;
}

.preview-jump:hover,
.preview-jump:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.05);
    outline: none;
}

.timeline {
    display: grid;
    gap: 9px;
}

.timeline-entry {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 2px solid #4a73a5;
    background: linear-gradient(180deg, #e9f3ff 0%, #d4e7fb 100%);
    padding: 10px;
    overflow: hidden;
    isolation: isolate;
}

.timeline-entry time {
    display: block;
    font-family: var(--pixel-font);
    font-size: 12px;
    color: #37537a;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    align-self: start;
    padding: 5px 6px;
    border: 2px solid #6687b3;
    background: linear-gradient(180deg, #f2f8ff 0%, #dceafb 100%);
}

.timeline-entry .publication-card,
.timeline-entry .publication-body,
.timeline-entry .publication-content {
    min-width: 0;
}

.timeline-entry .publication-card {
    width: 100%;
    position: relative;
    z-index: 1;
}

.timeline-entry .publication-content {
    overflow-wrap: anywhere;
}

#publications .timeline-entry,
#news .timeline-entry {
    row-gap: 12px;
    padding: 12px;
}

#publications .timeline-entry time,
#news .timeline-entry time {
    font-size: 12px;
    letter-spacing: 0.3px;
    text-align: left;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

#publications .publication-content h3,
#news .publication-content h3 {
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(58, 103, 150, 0.36);
    margin-bottom: 10px;
}

#publications .publication-content p,
#news .publication-content p,
#news .entry-secondary {
    color: #20466f;
}

#news .publication-card {
    background: linear-gradient(180deg, #f5f9ff 0%, #e2eefb 100%);
}

.entry-link-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    vertical-align: middle;
    border: 2px solid #2f5d93;
    background:
        linear-gradient(180deg, #fff0c4 0%, #ffc977 100%),
        repeating-linear-gradient(90deg, transparent 0, transparent 2px, rgba(0, 0, 0, 0.06) 2px, rgba(0, 0, 0, 0.06) 3px);
    box-shadow: 0 2px 0 #a76318;
    position: relative;
}

.entry-link-icon::before,
.entry-link-icon::after {
    content: "";
    position: absolute;
    background: #6d3d0a;
}

.entry-link-icon::before {
    width: 8px;
    height: 2px;
    top: 4px;
    left: 4px;
}

.entry-link-icon::after {
    width: 2px;
    height: 8px;
    top: 4px;
    left: 10px;
}

.entry-link-icon:hover,
.entry-link-icon:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.06);
    outline: none;
}

.footer-line {
    margin-top: 18px;
    font-family: var(--pixel-font);
    font-size: 12px;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-top: 2px solid #4f79ad;
    color: #d6eaff;
    padding-top: 10px;
}

.led {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 5px;
    background: var(--danger-pixel);
    border: 1px solid #692c1e;
    box-shadow: 0 0 8px rgba(167, 79, 61, 0.7);
    animation: blink 1.5s steps(2) infinite;
}

.loading {
    font-family: var(--pixel-font);
    font-size: 13px;
    padding: 6px 0;
    color: #214a7c;
}

@keyframes slimeBop {
    0% {
        transform: scale(1.05, 0.9);
    }
    50% {
        transform: scale(0.96, 1.1);
    }
    100% {
        transform: scale(1, 1);
    }
}

@keyframes castPulse {
    0% {
        transform: translateX(-50%) scale(1);
    }
    40% {
        transform: translateX(-50%) scale(1.08);
    }
    100% {
        transform: translateX(-50%) scale(1);
    }
}

@keyframes swordSlash {
    0% {
        transform: rotate(0deg) translateY(0);
    }
    40% {
        transform: rotate(20deg) translateY(-2px);
    }
    100% {
        transform: rotate(-18deg) translateY(1px);
    }
}

@keyframes bowDraw {
    0% {
        transform: scaleX(1);
    }
    45% {
        transform: scaleX(0.82) translateX(-1px);
    }
    100% {
        transform: scaleX(1.06);
    }
}

@keyframes staffCast {
    0% {
        transform: translateY(0);
    }
    45% {
        transform: translateY(-3px) rotate(-6deg);
    }
    100% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes spriteSwordSlash {
    0% {
        transform: translateX(-50%) rotate(0deg) translateY(0);
    }
    40% {
        transform: translateX(-50%) rotate(8deg) translateY(-2px);
    }
    100% {
        transform: translateX(-50%) rotate(-7deg) translateY(1px);
    }
}

@keyframes spriteBowDraw {
    0% {
        transform: translateX(-50%) scaleX(1);
    }
    45% {
        transform: translateX(-50%) scaleX(0.96) translateX(-1px);
    }
    100% {
        transform: translateX(-50%) scaleX(1.04);
    }
}

@keyframes spriteStaffCast {
    0% {
        transform: translateX(-50%) translateY(0);
    }
    45% {
        transform: translateX(-50%) translateY(-3px) scale(1.02);
    }
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes fightSwordFrames {
    0%, 49.9% {
        background-position: var(--fight-frame0-x) var(--fight-row-y);
    }
    50%, 100% {
        background-position: var(--fight-frame1-x) var(--fight-row-y);
    }
}

@keyframes fightHealerFrames {
    0%, 49.9% {
        background-position: var(--fight-frame0-x) var(--fight-row-y);
    }
    50%, 100% {
        background-position: var(--fight-frame1-x) var(--fight-row-y);
    }
}

@keyframes fightArcherFrames {
    0%, 49.9% {
        background-position: var(--fight-frame0-x) var(--fight-row-y);
    }
    50%, 100% {
        background-position: var(--fight-frame1-x) var(--fight-row-y);
    }
}

@keyframes fightMageFrames {
    0%, 49.9% {
        background-position: var(--fight-frame0-x) var(--fight-row-y);
    }
    50%, 100% {
        background-position: var(--fight-frame1-x) var(--fight-row-y);
    }
}

@keyframes supportAura {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    25% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

@keyframes dummyHit {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes damagePop {
    0% {
        opacity: 0;
        transform: translateY(2px) scale(0.9);
    }
    15% {
        opacity: 1;
        transform: translateY(-2px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-24px) scale(1.05);
    }
}

@keyframes blink {
    0%, 80%, 100% { opacity: 1; }
    40% { opacity: 0.35; }
}

@keyframes panelIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bootUp {
    from {
        filter: brightness(0.5) contrast(1.2);
        transform: scaleY(0.97);
    }
    to {
        filter: brightness(1) contrast(1);
        transform: scaleY(1);
    }
}

@media (max-width: 980px) {
    .console-wrap {
        width: min(1380px, 100%);
    }

    .tab-bar {
        grid-template-columns: repeat(4, minmax(160px, 1fr));
    }

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

    .page-layout {
        grid-template-columns: 1fr;
    }

    .top-right-stack {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    .console-wrap {
        padding: 14px;
    }

    .hero-screen {
        padding: 15px 12px;
    }

    .boot-row {
        font-size: 10px;
    }

    .meta-playground {
        min-height: 180px;
    }

    .tama-status-trigger {
        top: 6px;
        right: 6px;
    }

    .tama-panel {
        top: 14px;
        left: 6px;
        width: min(220px, calc(100% - 12px));
        display: block;
    }

    .tama-controls {
        margin-top: 6px;
        grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    }

    .meta-hud {
        font-size: 10px;
        padding: 8px;
    }

    .pak-tab {
        min-height: 72px;
        font-size: 11px;
        padding: 14px 8px 10px;
    }

    .panel {
        min-height: 380px;
        padding: 12px;
    }

    .timeline-entry {
        grid-template-columns: 1fr;
    }

    .publication-body {
        grid-template-columns: 1fr;
    }

    .footer-line {
        flex-direction: column;
        gap: 4px;
    }
}


