.player-app {
    --rail-width: 224px;
    --context-width: 292px;
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--rail-width) minmax(0, 1fr) var(--context-width);
    background:
        radial-gradient(circle at 55% -15%, rgb(197 155 82 / 10%), transparent 32rem),
        #0c0a08;
}

button { color: inherit; }
.player-mobile-head, .player-bottom-nav { display: none; }

.player-rail {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    height: 100vh;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid #33291f;
    background: linear-gradient(165deg, #19140f 0%, #0e0c0a 72%);
    box-shadow: 14px 0 50px rgb(0 0 0 / 16%);
}
.player-rail::after {
    position: absolute;
    top: 0;
    right: 5px;
    bottom: 0;
    width: 1px;
    background: rgb(197 155 82 / 12%);
    content: "";
}
.player-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 22px 20px;
    border: 0;
    color: var(--ink);
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.player-brand > span {
    display: grid;
    width: 42px;
    height: 47px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    background: linear-gradient(145deg, #302519, #15110d);
    clip-path: polygon(50% 0, 100% 18%, 89% 82%, 50% 100%, 11% 82%, 0 18%);
    font: 700 1.35rem Cinzel, Georgia, serif;
}
.player-brand strong { display: block; font: 650 .98rem Cinzel, Georgia, serif; letter-spacing: .05em; }
.player-brand small { display: block; color: var(--muted); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }

.player-rail nav { display: grid; gap: 5px; padding: 18px 13px; }
.player-rail nav button {
    position: relative;
    display: grid;
    min-height: 48px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #a79a89;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.player-rail nav button i { color: #786a59; font: normal 1.1rem Georgia, serif; text-align: center; }
.player-rail nav button span { font-size: .74rem; font-weight: 750; letter-spacing: .02em; }
.player-rail nav button b, .player-bottom-nav b {
    display: grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    border-radius: 50%;
    color: #170f09;
    background: var(--gold-bright);
    font-size: .59rem;
}
.player-rail nav button em { color: #86a88f; font-size: .57rem; font-style: normal; text-transform: uppercase; }
.player-rail nav button:hover { color: var(--ink); background: rgb(255 255 255 / 2%); }
.player-rail nav button.is-active {
    border-color: #463827;
    color: var(--ink);
    background: linear-gradient(90deg, rgb(197 155 82 / 14%), rgb(197 155 82 / 2%));
    box-shadow: inset 2px 0 var(--gold);
}
.player-rail nav button.is-active i { color: var(--gold-bright); }
.player-rail footer { display: grid; gap: 8px; margin-top: auto; padding: 18px 22px; border-top: 1px solid #2b241d; }
.player-rail footer a { color: #8e8171; font-size: .66rem; }
.player-rail footer a:hover { color: var(--gold-bright); }

.player-main { min-width: 0; padding: clamp(24px, 3.2vw, 50px); }
.player-panel { width: min(1160px, 100%); min-width: 0; margin: 0 auto; animation: panel-in .22s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }

.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 25px;
}
.panel-heading > div > span, .eyebrow {
    color: var(--gold);
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .2em;
}
.panel-heading h1 { margin: 5px 0 7px; font-size: clamp(1.75rem, 4vw, 2.8rem); }
.panel-heading p { max-width: 660px; }
.panel-heading time { color: #877a6a; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }

.hero-dashboard { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 18px; }
.hero-identity-card, .next-scene-card, .dashboard-card, .journal-card, .story-stage, .story-info,
.messenger, .player-rule-results article, .combat-preview, .character-surface {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(145deg, rgb(32 26 20 / 96%), rgb(19 16 13 / 96%));
    box-shadow: 0 18px 50px rgb(0 0 0 / 17%);
}
.hero-identity-card {
    position: relative;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) 125px;
    align-items: center;
    gap: 21px;
    min-height: 205px;
    overflow: hidden;
    padding: 26px;
}
.hero-identity-card::before {
    position: absolute;
    inset: 0;
    opacity: .35;
    background: radial-gradient(circle at 14% 50%, rgb(82 112 109 / 35%), transparent 31%), repeating-linear-gradient(120deg, transparent 0 28px, rgb(255 255 255 / 1.5%) 29px 30px);
    content: "";
}
.hero-identity-card > * { position: relative; }
.hero-portrait {
    position: relative;
    display: grid;
    width: 104px;
    height: 122px;
    place-items: center;
    border: 1px solid #887049;
    color: #e0c087;
    background: radial-gradient(circle at 50% 30%, #3b5b59, #17201f 52%, #100e0c 53%);
    clip-path: polygon(50% 0, 95% 13%, 100% 77%, 50% 100%, 0 77%, 5% 13%);
    font: 700 3.3rem Cinzel, Georgia, serif;
}
.hero-portrait i { position: absolute; inset: 6px; border: 1px solid rgb(226 192 125 / 28%); clip-path: inherit; }
.hero-identity-card small, .next-scene-card small, .dashboard-card small, .journal-card small { color: var(--gold); font-size: .61rem; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.hero-identity-card h2 { margin: 5px 0 10px; font-size: 1.4rem; }
.hero-identity-card p { font: italic .78rem/1.6 Georgia, serif; }
.hero-resource { display: grid; gap: 6px; align-self: stretch; align-content: center; }
.hero-resource span { font-size: .66rem; }
.hero-resource span b { color: #d5a095; font-size: 1rem; }
.hero-resource span:nth-of-type(2) b { color: #91b7c5; }
.hero-resource i { height: 5px; overflow: hidden; border-radius: 5px; background: #261512; }
.hero-resource i::before { display: block; width: var(--value); height: 100%; background: linear-gradient(90deg, #813f38, #c87063); content: ""; }
.hero-resource i.is-focus { background: #111d22; }
.hero-resource i.is-focus::before { background: linear-gradient(90deg, #486e80, #78a6b9); }

.next-scene-card { position: relative; display: flex; min-height: 205px; flex-direction: column; justify-content: center; overflow: hidden; padding: 28px; }
.next-scene-card::after { position: absolute; right: -28px; bottom: -54px; color: rgb(197 155 82 / 5%); content: "✦"; font-size: 12rem; }
.next-scene-card > * { position: relative; z-index: 1; }
.next-scene-card .card-rune { position: absolute; top: 18px; right: 20px; color: #735f41; font-size: 1.7rem; }
.next-scene-card h2 { margin: 7px 0 9px; font-size: 1.2rem; }
.next-scene-card p { font-size: .74rem; }
.next-scene-card button { align-self: flex-start; margin-top: 16px; padding: 0; border: 0; color: var(--gold-bright); background: transparent; font-size: .68rem; cursor: pointer; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.dashboard-card, .journal-card { display: flex; min-height: 145px; align-items: flex-start; gap: 15px; padding: 20px; text-align: left; }
.dashboard-card { cursor: pointer; }
.dashboard-card:hover { border-color: var(--line-bright); transform: translateY(-2px); }
.dashboard-card > span, .journal-card > span { display: grid; width: 42px; height: 42px; place-items: center; flex: 0 0 auto; border: 1px solid #55442f; border-radius: 50%; color: var(--gold-bright); background: #17120e; font-size: 1.2rem; }
.dashboard-card h3, .journal-card h3 { margin: 5px 0 6px; font-size: .93rem; }
.dashboard-card p, .journal-card p { font-size: .7rem; }
.journal-card { grid-column: 1 / -1; min-height: auto; }
.journal-card ul { display: flex; gap: 8px 20px; padding: 11px 0 0; list-style: none; color: #aa9d8d; font-size: .67rem; }
.journal-card li::before { margin-right: 6px; color: #665644; content: "◇"; }
.journal-card li.is-done { color: #71877a; text-decoration: line-through; }
.journal-card li.is-done::before { color: #74927a; content: "◆"; }

.character-hero {
    position: relative;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 24px;
    overflow: hidden;
    padding: 24px 28px;
    border: 1px solid var(--line);
    border-radius: 13px 13px 0 0;
    background: radial-gradient(circle at 8% 50%, rgb(70 105 100 / 30%), transparent 22rem), linear-gradient(115deg, #211b15, #13100d);
}
.character-hero::after { position: absolute; right: 25%; color: rgb(197 155 82 / 4%); content: "✦"; font-size: 10rem; transform: rotate(18deg); }
.character-hero > * { position: relative; z-index: 1; }
.character-emblem { position: relative; display: grid; width: 76px; height: 85px; place-items: center; border: 1px solid #8b724a; color: var(--gold-bright); background: #172321; clip-path: polygon(50% 0, 96% 18%, 88% 82%, 50% 100%, 12% 82%, 4% 18%); font: 700 2.4rem Cinzel, Georgia, serif; }
.character-emblem i { position: absolute; right: 7px; bottom: 12px; color: #84aab7; font-size: .8rem; font-style: normal; }
.character-hero h1 { margin: 4px 0; font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
.character-level { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.character-level small { color: var(--muted); font-size: .63rem; text-transform: uppercase; letter-spacing: .12em; }
.character-level strong { grid-row: 2; color: var(--gold-bright); font: 650 1.35rem Cinzel, Georgia, serif; }
.character-level > span { align-self: end; color: var(--muted); font-size: .68rem; }
.character-level > i { grid-column: 1 / -1; height: 5px; overflow: hidden; margin-top: 7px; border-radius: 4px; background: #100d0a; }
.character-level > i b { display: block; height: 100%; background: linear-gradient(90deg, #806137, var(--gold-bright)); }
.character-tabs { display: flex; overflow-x: auto; border: 1px solid var(--line); border-top: 0; background: #12100d; scrollbar-width: none; }
.character-tabs button { min-width: 125px; flex: 1; padding: 14px 16px; border: 0; border-bottom: 2px solid transparent; color: #8d8172; background: transparent; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.character-tabs button.is-active { border-bottom-color: var(--gold); color: var(--gold-bright); background: rgb(197 155 82 / 5%); }
[data-character-content] { padding-top: 18px; }
.character-surface { padding: 22px; }
.character-section-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.character-section-title h2 { font-size: 1.15rem; }
.character-section-title p { font-size: .68rem; }
.sheet-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
.sheet-grid > *, .attribute-groups > * { min-width: 0; }
.vital-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-content: start; }
.vital-card { display: grid; min-height: 107px; place-content: center; border: 1px solid #3c3025; border-radius: 9px; background: #14110e; text-align: center; }
.vital-card strong { color: var(--vital, var(--gold-bright)); font: 700 1.55rem Cinzel, Georgia, serif; }
.vital-card span { color: #84786a; font-size: .58rem; text-transform: uppercase; letter-spacing: .12em; }
.vital-card.is-wide { grid-column: 1 / -1; min-height: 75px; }
.attribute-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.attribute-group { padding: 15px; border: 1px solid #352c23; border-radius: 9px; background: rgb(15 13 11 / 60%); }
.attribute-group > b { display: flex; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid #2d251d; color: var(--gold); font: 650 .76rem Cinzel, Georgia, serif; }
.attribute-group > b em { color: #778f7d; font-style: normal; }
.attribute-line { display: flex; align-items: center; justify-content: space-between; padding-top: 7px; color: #a89b8b; font-size: .68rem; }
.attribute-line strong { display: grid; min-width: 25px; height: 25px; place-items: center; border: 1px solid #3c3025; border-radius: 50%; color: var(--ink); font-size: .65rem; }
.derived-row { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 5px; }
.derived-row div { padding: 10px; border: 1px solid #342a21; border-radius: 7px; background: #110f0d; }
.derived-row span { display: block; color: #796e61; font-size: .56rem; text-transform: uppercase; }
.derived-row strong { font: 650 .9rem Cinzel, Georgia, serif; }

.talent-layout, .equipment-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
.talent-map {
    position: relative;
    min-height: 500px;
    overflow: auto;
    padding: 34px;
    border: 1px solid #342a21;
    border-radius: 10px;
    background: radial-gradient(circle at 15% 50%, rgb(64 105 96 / 12%), transparent 20rem), #100e0c;
}
.talent-map svg { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; overflow: visible; }
.talent-map svg path { fill: none; stroke: #5f4d33; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.talent-map svg path.is-lit { stroke: var(--gold); filter: drop-shadow(0 0 4px rgb(197 155 82 / 25%)); }
.talent-node { position: absolute; z-index: 2; display: grid; width: 64px; height: 64px; place-items: center; border: 2px solid #5b4932; border-radius: 50%; color: #b6aa99; background: radial-gradient(circle, #282016, #100e0c 70%); box-shadow: 0 0 0 5px #100e0c, 0 6px 16px #000; cursor: pointer; }
.talent-node span { font-size: 1.4rem; }
.talent-node small { position: absolute; top: 67px; width: 105px; color: #8f8271; font-size: .56rem; font-weight: 750; text-align: center; }
.talent-node.is-known { border-color: #a88146; color: var(--gold-bright); background: radial-gradient(circle, #59411e, #17110b 72%); }
.talent-node.is-active { outline: 2px solid var(--gold-bright); outline-offset: 4px; }
.talent-detail, .equipment-detail { padding: 20px; border: 1px solid #3b3025; border-radius: 10px; background: #12100e; }
.talent-detail > span, .equipment-detail > span { color: var(--gold); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; }
.talent-detail h3, .equipment-detail h3 { margin: 7px 0 10px; font-size: 1.05rem; }
.talent-detail p, .equipment-detail p { font-size: .7rem; }
.talent-meta { display: grid; gap: 7px; margin: 17px 0; }
.talent-meta div { display: flex; justify-content: space-between; padding-bottom: 7px; border-bottom: 1px solid #2b241d; color: #8d8172; font-size: .63rem; }
.talent-meta b { font-size: .63rem; }
.full-tree-link { display: block; margin-top: 16px; padding: 10px; border: 1px solid #5b472c; border-radius: 6px; color: var(--gold-bright); text-align: center; font-size: .65rem; }

.spell-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.spell-card { position: relative; min-height: 205px; overflow: hidden; padding: 18px; border: 1px solid #3c3025; border-radius: 10px; color: inherit; background: linear-gradient(155deg, #1c2424, #12100e 70%); text-align: left; cursor: pointer; }
.spell-card::after { position: absolute; right: -7px; bottom: -33px; color: rgb(116 154 166 / 8%); content: attr(data-rune); font: 5rem Georgia, serif; }
.spell-card > * { position: relative; z-index: 1; }
.spell-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 19px; border: 1px solid #56727d; border-radius: 50%; color: #a4d1df; background: #10191c; font-size: 1.35rem; box-shadow: 0 0 22px rgb(87 137 154 / 15%); }
.spell-card h3 { margin-bottom: 7px; font-size: .93rem; }
.spell-card p { font-size: .66rem; }
.spell-card footer { display: flex; gap: 7px; margin-top: 15px; }
.spell-card footer span { padding: 3px 7px; border: 1px solid #3c4d51; border-radius: 9px; color: #8eabb3; font-size: .55rem; }

.paper-doll { position: relative; display: grid; min-height: 420px; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 14px; place-items: center; padding: 24px; border: 1px solid #342a21; border-radius: 10px; background: radial-gradient(ellipse, rgb(197 155 82 / 8%), transparent 60%), #100e0c; }
.paper-doll::before { position: absolute; color: rgb(197 155 82 / 5%); content: "♙"; font-size: 18rem; }
.gear-slot { z-index: 1; display: grid; width: 72px; height: 72px; place-items: center; border: 1px solid #54442f; border-radius: 10px; color: var(--gold-bright); background: #18130f; font-size: 1.5rem; cursor: pointer; }
.gear-slot small { display: block; color: #8d8172; font-size: .52rem; }
.gear-slot.is-empty { border-style: dashed; color: #4e4438; }
.gear-slot:nth-child(2), .gear-slot:nth-child(5), .gear-slot:nth-child(8) { grid-column: 2; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.inventory-item { display: grid; min-height: 62px; place-items: center; border: 1px solid #362c23; border-radius: 7px; color: #b4a895; background: #17130f; cursor: pointer; }

.messenger { display: grid; min-height: 620px; grid-template-columns: 260px minmax(0, 1fr); overflow: hidden; }
.channel-list { border-right: 1px solid var(--line); background: #12100e; }
.channel-list button { display: grid; width: 100%; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 15px 13px; border: 0; border-bottom: 1px solid #2b241d; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.channel-list button:hover, .channel-list button.is-active { background: rgb(197 155 82 / 7%); }
.channel-list button > i { display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid #473925; border-radius: 50%; color: var(--gold-bright); background: #19140f; font-style: normal; }
.channel-list button b, .channel-list button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-list button b { font-size: .68rem; }
.channel-list button small { color: #7c7164; font-size: .59rem; }
.channel-list button em { display: grid; min-width: 19px; height: 19px; place-items: center; border-radius: 50%; color: #170f09; background: var(--gold-bright); font-size: .57rem; font-style: normal; }
.conversation { display: grid; min-width: 0; grid-template-rows: auto 1fr auto; background: radial-gradient(circle at 50% 40%, rgb(197 155 82 / 3%), transparent 30rem); }
.conversation > header { display: flex; align-items: center; gap: 12px; min-height: 67px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.conversation > header button { display: none; border: 0; color: var(--gold-bright); background: transparent; font-size: 1.8rem; }
.conversation > header div { min-width: 0; flex: 1; }
.conversation > header b, .conversation > header small { display: block; }
.conversation > header b { font-size: .75rem; }
.conversation > header small { color: #817568; font-size: .59rem; }
.conversation > header > span { color: #73907a; font-size: .56rem; text-transform: uppercase; }
.message-stream { display: flex; min-height: 0; flex-direction: column; gap: 14px; overflow: auto; padding: 22px; }
.message-row { display: flex; max-width: 76%; gap: 9px; }
.message-row.is-self { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { display: grid; width: 30px; height: 30px; place-items: center; flex: 0 0 auto; border: 1px solid #4b3b28; border-radius: 50%; color: var(--gold-bright); background: #17130f; font-size: .62rem; }
.message-bubble { padding: 10px 12px; border: 1px solid #3a3025; border-radius: 3px 10px 10px; background: #1b1713; }
.message-row.is-self .message-bubble { border-color: #4b4d3d; border-radius: 10px 3px 10px 10px; background: #20261f; }
.message-bubble b { display: block; color: var(--gold); font-size: .57rem; }
.message-bubble p { color: #c8bcad; font-size: .69rem; }
.message-bubble time { color: #70665a; font-size: .52rem; }
.message-compose { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 13px; border-top: 1px solid var(--line); background: #12100e; }
.message-compose input { min-width: 0; padding: 10px 12px; border: 1px solid #3a3025; border-radius: 7px; outline: 0; color: var(--ink); background: #0d0c0a; }
.message-compose input:focus { border-color: var(--gold); }
.message-compose button { padding: 8px 13px; border: 1px solid #564329; border-radius: 6px; color: var(--gold-bright); background: #21190f; cursor: pointer; }

.live-badge, .combat-ready { padding: 6px 10px; border: 1px solid #5b3a32; border-radius: 15px; color: #d58c7e; background: #241411; font-size: .58rem; font-weight: 800; letter-spacing: .1em; }
.story-stage { overflow: hidden; }
.story-image { position: relative; min-height: clamp(330px, 48vw, 610px); overflow: hidden; background: linear-gradient(#0d1720 0 53%, #18201f 53% 55%, #0b0e0d 55%); }
.story-image::before { position: absolute; inset: 0; background: radial-gradient(ellipse at 72% 83%, rgb(69 87 78 / 50%), transparent 30%), linear-gradient(110deg, transparent 56%, rgb(163 185 189 / 8%) 57% 58%, transparent 59%); content: ""; }
.story-moon { position: absolute; top: 8%; right: 12%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: #bbc6bb; box-shadow: 0 0 60px #a7bab0; }
.story-moon::after { position: absolute; top: -5%; left: -20%; width: 100%; height: 100%; border-radius: 50%; background: #101923; content: ""; }
.story-ruin { position: absolute; right: 20%; bottom: 26%; left: 12%; height: 37%; border: solid #272d2c; border-width: 17px 19px 0; background: linear-gradient(90deg, transparent 15%, #0d1111 15% 27%, transparent 27% 67%, #0d1111 67% 80%, transparent 80%); box-shadow: inset 0 0 0 5px #111717; }
.story-ruin::before { position: absolute; top: -29%; left: -3%; width: 28%; height: 33%; border: solid #272d2c; border-width: 15px 15px 0; content: ""; }
.story-ruin i { position: absolute; bottom: 0; width: 5%; height: 142%; background: #252b2a; box-shadow: inset 5px 0 #1b2020; }
.story-ruin i:nth-child(1) { left: 5%; }.story-ruin i:nth-child(2) { left: 45%; height: 108%; }.story-ruin i:nth-child(3) { right: 4%; height: 130%; }
.story-gate { position: absolute; bottom: 26%; left: 44%; display: grid; width: 14%; height: 27%; place-items: center; border: 9px solid #292f2e; border-radius: 50% 50% 0 0; color: #759ba3; background: radial-gradient(circle, #28444a, #0d1315 60%); font-size: 2.5rem; text-shadow: 0 0 15px #82bbc6; }
.story-image svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.story-image svg path, .story-image svg circle { fill: none; stroke: #ce6658; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 12 8; vector-effect: non-scaling-stroke; }
.story-pin { position: absolute; display: grid; width: 38px; height: 38px; place-items: center; border: 2px solid #f0c56e; border-radius: 50%; color: #1c1308; background: #d5a84f; box-shadow: 0 0 0 6px rgb(213 168 79 / 15%); cursor: pointer; }
.story-pin.is-active { transform: scale(1.15); box-shadow: 0 0 0 8px rgb(213 168 79 / 23%); }
.gm-note { position: absolute; top: 13%; left: 7%; max-width: 260px; padding: 10px 14px; border: 2px solid #bd5e51; color: #e9c8bc; background: rgb(59 20 17 / 82%); font: italic .82rem/1.4 Georgia, serif; transform: rotate(-2deg); }
.story-stage.is-clean svg, .story-stage.is-clean .story-pin, .story-stage.is-clean .gm-note { display: none; }
.story-stage footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; }
.story-stage footer > div { display: flex; align-items: center; gap: 10px; }
.story-stage footer > div > span { color: var(--gold); }
.story-stage footer b, .story-stage footer small { display: block; font-size: .63rem; }
.story-stage footer small { color: #7d7265; }
.story-stage footer button { padding: 7px 10px; border: 1px solid #473929; border-radius: 6px; color: #aa9d8d; background: #15110e; cursor: pointer; }
.story-info { margin-top: 14px; padding: 20px; }
.story-info span { color: var(--gold); font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.story-info h2 { margin: 4px 0 7px; font-size: 1rem; }
.story-info p { font-size: .7rem; }

.player-rule-search { display: grid; grid-template-columns: 35px minmax(0, 1fr); align-items: center; width: min(710px, 100%); margin-bottom: 20px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #11100e; }
.player-rule-search span { color: var(--gold); font-size: 1.2rem; }
.player-rule-search input { min-height: 50px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.rule-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.rule-shortcuts a { display: grid; min-height: 125px; place-content: center; padding: 15px; border: 1px solid var(--line); border-radius: 10px; color: inherit; background: #15120f; text-align: center; }
.rule-shortcuts a:hover { border-color: var(--gold); }
.rule-shortcuts a > span { color: var(--gold-bright); font-size: 1.45rem; }
.rule-shortcuts b, .rule-shortcuts small { display: block; }
.rule-shortcuts b { margin-top: 5px; font: 650 .8rem Cinzel, Georgia, serif; }
.rule-shortcuts small { color: #817568; font-size: .58rem; }
.player-rule-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.player-rule-results article { padding: 18px; }
.player-rule-results article > span { color: var(--gold); font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.player-rule-results h2 { margin: 4px 0 8px; font-size: .96rem; }
.player-rule-results p { font-size: .68rem; }
.player-rule-results a { display: inline-block; margin-top: 11px; font-size: .61rem; }
.rule-empty { grid-column: 1 / -1; padding: 35px; color: #887c6d; text-align: center; }

.combat-preview { display: grid; min-height: 565px; grid-template-columns: minmax(0, 1fr) 300px; overflow: hidden; }
.combat-preview-map { position: relative; min-height: 500px; overflow: hidden; background-color: #18221c; background-image: linear-gradient(30deg, rgb(255 255 255 / 2%) 12%, transparent 12.5%, transparent 87%, rgb(255 255 255 / 2%) 87.5%), linear-gradient(150deg, rgb(255 255 255 / 2%) 12%, transparent 12.5%, transparent 87%, rgb(255 255 255 / 2%) 87.5%); background-size: 28px 48px; }
.combat-preview-map::before { position: absolute; inset: 10% 6% 18%; border: 13px solid #49453a; border-bottom-width: 22px; background: radial-gradient(circle at 48% 50%, #263b2c 0 10%, transparent 11%), linear-gradient(130deg, transparent 48%, #242d24 49% 53%, transparent 54%); content: ""; box-shadow: 0 7px 20px #0008; }
.preview-wall { position: absolute; z-index: 1; top: 18%; left: 47%; width: 9%; height: 43%; background: #555044; transform: rotate(17deg); box-shadow: 0 4px 8px #0008; }
.preview-token { position: absolute; z-index: 3; display: grid; width: 46px; height: 46px; place-items: center; border: 3px solid #cba75f; border-radius: 50%; color: #f4dfb4; background: #173536; box-shadow: 0 4px 14px #000, 0 0 0 4px rgb(0 0 0 / 40%); font: 700 .9rem Cinzel, Georgia, serif; }
.preview-token.is-enemy { border-color: #a14e43; color: #e9a59b; background: #391713; }
.preview-fog { position: absolute; z-index: 2; inset: 0 0 0 58%; background: linear-gradient(90deg, transparent, rgb(8 9 8 / 80%) 24%, #080908); pointer-events: none; }
.combat-preview aside { display: flex; flex-direction: column; padding: 25px; border-left: 1px solid var(--line); background: #14110e; }
.combat-preview aside > span { color: var(--gold); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; }
.combat-preview aside h2 { margin: 8px 0 10px; font-size: 1.18rem; }
.combat-preview aside > p { margin-bottom: 22px; font-size: .7rem; }
.combat-preview aside > div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid #2e271f; font-size: .64rem; }
.combat-preview aside > div span { color: #8b7f70; }
.launch-combat { margin-top: auto; padding: 12px; border: 1px solid #6b522f; border-radius: 7px; color: #171009; background: linear-gradient(#e0bc75, #b8873b); text-align: center; font-size: .66rem; font-weight: 800; }

.player-context { position: sticky; top: 0; height: 100vh; overflow: auto; padding: 30px 22px; border-left: 1px solid #30271f; background: rgb(16 14 11 / 92%); }
.context-label { color: var(--gold); font-size: .57rem; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; }
.player-context h2 { margin: 6px 0 18px; font-size: 1.05rem; }
.context-card { margin-bottom: 12px; padding: 14px; border: 1px solid #352c23; border-radius: 8px; background: #17130f; }
.context-card > span { color: #7d7164; font-size: .56rem; text-transform: uppercase; }
.context-card h3 { margin: 4px 0; font-size: .78rem; }
.context-card p { font-size: .63rem; }
.party-row { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid #2c251e; }
.party-row i { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #4d3d28; border-radius: 50%; color: var(--gold); font-style: normal; }
.party-row b, .party-row small { display: block; font-size: .6rem; }
.party-row small { color: #776c60; }.party-row > span { color: #79947e; font-size: .55rem; }
.context-tip { margin-top: 18px; padding: 13px; border-left: 2px solid var(--gold); color: #918575; background: rgb(197 155 82 / 5%); font: italic .66rem/1.6 Georgia, serif; }

.player-toast { position: fixed; z-index: 100; right: 28px; bottom: 28px; max-width: 330px; padding: 12px 16px; border: 1px solid #6c5333; border-radius: 8px; color: #e6d8c3; background: #211a13; box-shadow: 0 15px 35px #0008; opacity: 0; transform: translateY(12px); transition: .2s ease; pointer-events: none; }
.player-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1200px) {
    .player-app { grid-template-columns: var(--rail-width) minmax(0, 1fr); }
    .player-context { display: none; }
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-card:last-of-type { grid-column: 1 / -1; }
    .hero-dashboard { grid-template-columns: 1fr; }
    .sheet-grid, .talent-layout, .equipment-layout { grid-template-columns: 1fr; }
    .spell-grid { grid-template-columns: 1fr 1fr; }
    .combat-preview { grid-template-columns: 1fr; }
    .combat-preview aside { border-top: 1px solid var(--line); border-left: 0; }
    .launch-combat { margin-top: 25px; }
}
@media (max-width: 720px) {
    body.player-app { display: block; }
    .player-rail { display: none; }
    .player-mobile-head {
        position: fixed;
        z-index: 50;
        top: 0;
        right: 0;
        left: 0;
        display: flex;
        min-height: 64px;
        align-items: center;
        justify-content: space-between;
        padding: 8px 14px;
        border-bottom: 1px solid #382e23;
        background: rgb(17 14 11 / 96%);
        backdrop-filter: blur(14px);
    }
    .player-mobile-head .player-brand { width: auto; padding: 0; }
    .player-mobile-head .player-brand > span { width: 35px; height: 40px; font-size: 1rem; }
    .player-mobile-head .player-brand strong { font-size: .82rem; }
    .player-mobile-head .player-brand small { font-size: .53rem; }
    .mobile-avatar { display: grid; width: 37px; height: 37px; place-items: center; border: 1px solid #7a623d; border-radius: 50%; color: var(--gold-bright); background: #1d271f; font-size: .62rem; }
    .player-main { padding: 84px 14px 93px; }
    .player-bottom-nav {
        position: fixed;
        z-index: 50;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        min-height: 70px;
        grid-template-columns: repeat(5, 1fr);
        padding: 4px max(4px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
        border-top: 1px solid #3a3025;
        background: rgb(17 14 11 / 97%);
        backdrop-filter: blur(15px);
    }
    .player-bottom-nav button { position: relative; display: grid; place-content: center; gap: 1px; border: 0; color: #7d7265; background: transparent; cursor: pointer; }
    .player-bottom-nav button i { font: normal 1.1rem Georgia, serif; }
    .player-bottom-nav button span { font-size: .52rem; font-weight: 750; }
    .player-bottom-nav button b { position: absolute; top: 4px; left: calc(50% + 5px); min-width: 16px; height: 16px; }
    .player-bottom-nav button.is-active { color: var(--gold-bright); }
    .panel-heading { align-items: flex-start; margin-bottom: 17px; }
    .panel-heading h1 { font-size: 1.72rem; }
    .panel-heading p { font-size: .7rem; line-height: 1.55; }
    .panel-heading time { display: none; }
    .hero-identity-card { grid-template-columns: 76px minmax(0, 1fr); gap: 15px; min-height: auto; padding: 18px; }
    .hero-portrait { width: 73px; height: 86px; font-size: 2.2rem; }
    .hero-identity-card h2 { font-size: 1.05rem; }
    .hero-identity-card p { font-size: .67rem; }
    .hero-resource { grid-column: 1 / -1; grid-template-columns: auto 1fr; }
    .hero-resource i { align-self: center; }
    .next-scene-card { min-height: 186px; padding: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-card, .dashboard-card:last-of-type, .journal-card { grid-column: auto; min-height: 112px; padding: 16px; }
    .journal-card ul { display: grid; }
    .character-hero { grid-template-columns: 66px 1fr; gap: 14px; padding: 17px; }
    .character-emblem { width: 60px; height: 68px; font-size: 1.8rem; }
    .character-hero h1 { font-size: 1.4rem; }
    .character-level { grid-column: 1 / -1; }
    .character-tabs { position: sticky; z-index: 15; top: 64px; }
    .character-tabs button { min-width: 105px; padding: 12px 9px; font-size: .59rem; }
    .character-surface { padding: 15px; }
    .character-section-title { flex-wrap: wrap; align-items: flex-start; }
    .character-section-title > a, .character-section-title > span { font-size: .63rem; }
    .attribute-groups, .derived-row { grid-template-columns: 1fr 1fr; }
    .derived-row { grid-column: auto; }
    .talent-map { min-width: 600px; min-height: 500px; }
    .talent-layout > div:first-child { overflow-x: auto; border-radius: 9px; }
    .spell-grid { grid-template-columns: 1fr; }
    .paper-doll { min-height: 390px; padding: 14px; }
    .messenger { display: block; min-height: calc(100vh - 190px); }
    .channel-list { min-height: calc(100vh - 190px); border-right: 0; }
    .conversation { display: none; min-height: calc(100vh - 190px); }
    .messenger.is-chat-open .channel-list { display: none; }
    .messenger.is-chat-open .conversation { display: grid; }
    .conversation > header button { display: block; }
    .message-stream { max-height: calc(100vh - 330px); padding: 15px; }
    .message-row { max-width: 88%; }
    .story-image { min-height: 365px; }
    .gm-note { top: 5%; left: 4%; max-width: 220px; font-size: .68rem; }
    .story-gate { width: 19%; }
    .story-stage footer { align-items: flex-start; }
    .story-stage footer button { flex: 0 0 auto; font-size: .57rem; }
    .rule-shortcuts { grid-template-columns: 1fr 1fr; }
    .rule-shortcuts a { min-height: 105px; }
    .player-rule-results { grid-template-columns: 1fr; }
    .combat-preview-map { min-height: 395px; }
    .combat-preview aside { padding: 19px; }
    .preview-token { width: 40px; height: 40px; }
    .player-toast { right: 14px; bottom: 84px; left: 14px; max-width: none; }
}
@media (max-width: 520px) {
    .attribute-groups { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
    .vital-panel { grid-template-columns: 1fr 1fr; }
    .story-stage footer > div { display: none; }
    .story-stage footer { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
    .player-panel { animation: none; }
    .dashboard-card, .story-pin, .player-toast { transition: none; }
}
