/* ============================================================
   STATUS NAK — JRPG Character Screen Portfolio
   ============================================================ */

@font-face {
    font-family: 'PersonifiedUX';
    src: url('../fonts/PersonifiedUX.woff2') format('woff2');
    font-display: swap;
}

:root {
    --void:        #05060a;
    --panel:       #0b0e17;
    --panel-hi:    #121728;
    --edge:        #1e2740;
    --edge-hot:    #2f3f6b;
    --red:         #e02a3f;
    --red-dim:     #7a1522;
    --gold:        #d4a843;
    --cyan:        #4fd6e8;
    --txt:         #c8d2e8;
    --txt-dim:     #5f6b8a;
    --bar-hp:      linear-gradient(180deg, #ff5a6e 0%, #c4122a 100%);
    --bar-mp:      linear-gradient(180deg, #6ee0f5 0%, #1a7f9e 100%);
    --bar-stat:    linear-gradient(180deg, #f0c95a 0%, #a87c1c 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    background: var(--void);
    color: var(--txt);
    font-family: 'PersonifiedUX', 'Courier New', monospace;
    overflow: hidden;
    -webkit-font-smoothing: none;
}

/* ---------- scanline overlay ---------- */
.crt::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        180deg,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.22) 3px,
        rgba(0,0,0,0.22) 4px
    );
}

.crt::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ---------- stage ---------- */
#stage {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
}

.screen {
    display: none;
    width: min(96vw, 1180px);
    height: min(92vh, 760px);
    position: relative;
}

.screen.active { display: block; }

/* ---------- summon circle ---------- */
#summon-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.summon-title {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    pointer-events: none;
}

.summon-title h1 {
    font-size: clamp(2rem, 7vw, 4.6rem);
    letter-spacing: 0.22em;
    color: var(--red);
    text-shadow:
        0 0 12px rgba(224,42,63,0.55),
        0 0 42px rgba(224,42,63,0.22);
    opacity: 0;
    animation: titleIn 1.4s 1.1s forwards;
}

@keyframes titleIn {
    0%   { opacity: 0; letter-spacing: 0.6em; filter: blur(9px); }
    100% { opacity: 1; letter-spacing: 0.22em; filter: blur(0); }
}

.summon-sub {
    position: absolute;
    bottom: 16%;
    width: 100%;
    text-align: center;
    color: var(--txt-dim);
    font-size: 0.82rem;
    letter-spacing: 0.4em;
    opacity: 0;
    animation: blinkIn 0.6s 2.6s forwards;
}

@keyframes blinkIn { to { opacity: 1; } }

/* ---------- status panel ---------- */
.panel {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(180deg, rgba(18,23,40,0.92), rgba(11,14,23,0.96));
    border: 1px solid var(--edge);
    box-shadow:
        inset 0 0 0 1px rgba(47,63,107,0.35),
        0 0 60px rgba(0,0,0,0.8);
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-rows: auto 1fr;
    opacity: 0;
    transform: scale(0.985);
    transition: opacity .5s ease, transform .5s ease;
}

.screen.active .panel { opacity: 1; transform: scale(1); }

/* ---------- header ---------- */
.panel-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 18px 26px 14px;
    border-bottom: 1px solid var(--edge);
    background: rgba(5,6,10,0.5);
}

.panel-head .name {
    font-size: 1.6rem;
    letter-spacing: 0.2em;
    color: #fff;
    text-shadow: 0 0 14px rgba(224,42,63,0.4);
}

.panel-head .class {
    margin-left: 16px;
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    color: var(--cyan);
}

.panel-head .lv {
    font-size: 1.05rem;
    letter-spacing: 0.16em;
    color: var(--gold);
}

.panel-head .lv b { font-size: 1.5rem; }

/* ---------- left column ---------- */
.col-left {
    padding: 22px;
    border-right: 1px solid var(--edge);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.avatar-frame {
    position: relative;
    aspect-ratio: 1;
    background: var(--panel);
    border: 1px solid var(--edge-hot);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.avatar-frame img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.08) saturate(0.85); }

.avatar-frame .frame-corners::before,
.avatar-frame .frame-corners::after {
    content: '';
    position: absolute;
    width: 26px; height: 26px;
    border: 2px solid var(--red);
}
.avatar-frame .frame-corners::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.avatar-frame .frame-corners::after  { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.vitals { display: flex; flex-direction: column; gap: 12px; }

.vital { font-size: 0.72rem; letter-spacing: 0.18em; }

.vital .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    color: var(--txt-dim);
}

.vital .row b { color: var(--txt); font-weight: normal; }

.bar {
    height: 12px;
    background: #060810;
    border: 1px solid var(--edge);
    position: relative;
    overflow: hidden;
}

.bar > i {
    display: block;
    height: 100%;
    width: 0;
    transition: width 1.1s cubic-bezier(.22,.9,.3,1);
}

.bar.hp > i { background: var(--bar-hp); }
.bar.mp > i { background: var(--bar-mp); }

.bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 9px, rgba(0,0,0,0.35) 9px 10px);
    pointer-events: none;
}

/* ---------- right column ---------- */
.col-right {
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.34em;
    color: var(--txt-dim);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--edge), transparent);
}

/* attributes */
.attrs { display: flex; flex-direction: column; gap: 11px; }

.attr {
    display: grid;
    grid-template-columns: 42px 1fr 116px;
    align-items: center;
    gap: 12px;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
}

.attr .k { color: var(--gold); }

.attr .bar { height: 9px; }
.attr .bar > i { background: var(--bar-stat); }

.attr .v { color: var(--txt-dim); font-size: 0.68rem; }

/* skills */
.skills { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
    padding: 7px 14px;
    background: var(--panel-hi);
    border: 1px solid var(--edge-hot);
    color: var(--txt);
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: background .16s, border-color .16s, color .16s, transform .1s;
}

.chip:hover, .chip:focus-visible {
    background: var(--red-dim);
    border-color: var(--red);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

.chip.known { border-color: var(--cyan); color: var(--cyan); }

/* nav */
.nav {
    margin-top: auto;
    display: flex;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--edge);
}

.nav button {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--edge-hot);
    color: var(--txt-dim);
    font-family: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    cursor: pointer;
    transition: all .18s;
}

.nav button:hover, .nav button.on {
    background: var(--red-dim);
    border-color: var(--red);
    color: #fff;
}

/* ---------- inventory ---------- */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.slot {
    aspect-ratio: 1;
    background: var(--panel);
    border: 1px solid var(--edge);
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
    transition: border-color .18s, transform .12s, box-shadow .18s;
}

.slot:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(212,168,67,0.14);
}

.slot .glyph { font-size: 1.7rem; opacity: 0.85; }

.slot .rar {
    position: absolute;
    top: 5px; right: 6px;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    padding: 2px 5px;
    border: 1px solid currentColor;
}

.rar.common    { color: var(--txt-dim); }
.rar.rare      { color: var(--cyan); }
.rar.legendary { color: var(--gold); }

.slot.locked { opacity: 0.35; cursor: not-allowed; }
.slot.locked:hover { transform: none; border-color: var(--edge); box-shadow: none; }

/* item card */
.item-card {
    border: 1px solid var(--edge-hot);
    background: var(--panel);
    padding: 18px 20px;
    display: none;
    flex-direction: column;
    gap: 8px;
}

.item-card.show { display: flex; animation: cardIn .28s ease; }

@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }

.item-card h3 { font-size: 1rem; letter-spacing: 0.16em; color: #fff; }
.item-card .meta { font-size: 0.66rem; letter-spacing: 0.2em; color: var(--gold); }
.item-card p { font-size: 0.78rem; line-height: 1.65; color: var(--txt); }

/* ---------- quest log ---------- */
.quests { display: flex; flex-direction: column; gap: 12px; }

.quest {
    border: 1px solid var(--edge);
    border-left: 3px solid var(--txt-dim);
    background: var(--panel);
    padding: 14px 18px;
    transition: border-color .18s;
}

.quest:hover { border-color: var(--edge-hot); border-left-color: var(--red); }

.quest .tag {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: var(--txt-dim);
}

.quest.active .tag { color: var(--red); }
.quest.done   .tag { color: var(--cyan); }

.quest h4 { font-size: 0.92rem; letter-spacing: 0.1em; margin: 6px 0 4px; color: #fff; }
.quest p  { font-size: 0.74rem; line-height: 1.6; color: var(--txt-dim); }

.quest a {
    display: inline-block;
    margin-top: 9px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: var(--cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.quest a:hover { border-bottom-color: var(--cyan); }

/* ---------- skill detail popover ---------- */
#skill-pop {
    position: fixed;
    z-index: 500;
    max-width: 300px;
    background: var(--panel-hi);
    border: 1px solid var(--red);
    box-shadow: 0 10px 40px rgba(0,0,0,0.85);
    padding: 14px 16px;
    display: none;
    pointer-events: none;
}

#skill-pop.show { display: block; }

#skill-pop h5 { font-size: 0.8rem; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 6px; }
#skill-pop p  { font-size: 0.72rem; line-height: 1.6; color: var(--txt); }

/* ---------- toast ---------- */
#toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%) translateY(20px);
    background: var(--panel-hi);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 10px 22px;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    z-index: 600;
    pointer-events: none;
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
    .panel { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
    .col-left { border-right: 0; border-bottom: 1px solid var(--edge); }
    .avatar-frame { max-width: 190px; margin: 0 auto; }
    .inv-grid { grid-template-columns: repeat(3, 1fr); }
    .attr { grid-template-columns: 38px 1fr; }
    .attr .v { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
