/* Kenji Origins: illustrated rooms and a playable training preview. */
:root {
  color-scheme: dark;
  --ink: #111312;
  --surface: #191b19;
  --paper: #f1efe9;
  --muted: #b7b9b1;
  --line: rgba(235, 237, 224, .19);
  --accent: #c65b46;
  --accent-light: #e08b74;
  --sans: "Geist", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body { margin: 0; font: 400 1rem/1.5 var(--sans); color: var(--paper); }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; cursor: pointer; border: 0; background: none; border-radius: 0; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 6px; }
h1:focus { outline: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: white; }
.dojo-app { --hall-width: max(100vw, 177.777778svh); --hall-height: max(100svh, 56.25vw); position: relative; isolation: isolate; min-height: 100svh; padding: 0 clamp(1.25rem, 4vw, 4rem); }
.dojo-app:focus { outline: none; }
.dojo-app.is-gated { height: 100svh; overflow: hidden; }
.dojo-scene { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.dojo-scene-art, .dojo-scene-video, .dojo-scene-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.dojo-scene-art { background-image: url("/dojo-central-hall-garden-v1.webp"); background-size: cover; background-position: center; }
.dojo-app[data-room="training"] .dojo-scene-art { background-image: url("/dojo-room-training-v1.png"); }
.dojo-app[data-room="clans"] .dojo-scene-art { background-image: url("/dojo-room-clans-v1.png"); }
.dojo-app[data-room="dungeon"] .dojo-scene-art { background-image: url("/dojo-room-dungeon-v1.png"); }
.dojo-scene-video { object-fit: cover; opacity: 0; transition: opacity .7s ease; }
.dojo-app.is-entered[data-room="hub"] .dojo-scene-art,
.dojo-app.is-entered[data-room="hub"] .dojo-scene-video { inset: auto; left: 50%; top: 50svh; width: var(--hall-width); height: var(--hall-height); transform: translate(-50%, -50%); }
.dojo-app.is-entered.has-scene-video[data-room="hub"] .dojo-scene-video { opacity: 1; }
.dojo-scene-shade { background: linear-gradient(180deg, rgba(10,13,12,.87), transparent 27%, rgba(10,13,12,.2) 43%, rgba(10,13,12,.91)), linear-gradient(90deg, rgba(10,13,12,.44), transparent 58%, rgba(10,13,12,.67)); transition: background .4s; }
.dojo-app.is-entered[data-room="hub"] .dojo-scene-shade { background: linear-gradient(180deg, rgba(10,13,12,.78), transparent 26%, transparent 63%, rgba(10,13,12,.72)); }
.dojo-app:not([data-room="hub"]) .dojo-scene-shade { background: rgba(10,13,12,.79); }
.dojo-app:not(.is-entered) .dojo-scene-shade { background: linear-gradient(180deg, rgba(9,12,10,.05) 40%, rgba(9,12,10,.55)); }
.dojo-topbar, .dojo-playfield { max-width: 1440px; margin-inline: auto; }
.dojo-topbar { position: relative; z-index: 2; min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--line); }
.dojo-brand { display: flex; align-items: center; gap: 1.2rem; flex-shrink: 0; }
.dojo-brand img { width: 96px; height: 52px; object-fit: contain; }
.brand-divider { width: 1px; height: 30px; background: var(--line); }
.dojo-wordmark { display: flex; flex-direction: column; gap: .1rem; }
.dojo-wordmark strong { font-size: 1rem; font-weight: 500; }
.dojo-mark { font-size: 18px; line-height: 1; color: var(--muted); }
.room-game-nav { display: flex; align-self: stretch; gap: 1.7rem; }
.room-game-nav button, .room-game-nav > a { position: relative; display: inline-flex; align-items: center; font-size: .875rem; padding: 0; color: var(--muted); white-space: nowrap; }
.room-game-nav button::after, .room-game-nav > a::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .2s ease; }
.room-game-nav button:hover, .room-game-nav button[aria-current="page"], .room-game-nav > a:hover { color: var(--paper); }
.room-game-nav button[aria-current="page"]::after { transform: scaleX(1); }
.room-game-nav button > span { font-family: var(--serif); margin-left: .35rem; color: var(--accent-light); }
.room-game-nav .dojo-buy-link { color: #ead29d; }
.room-game-nav .dojo-buy-link > span { margin-left: .35rem; color: #e08b74; }
.room-game-nav .dojo-buy-link:hover::after { transform: scaleX(1); }
.dojo-nav-actions { display: flex; align-items: center; gap: 1.3rem; }
.dojo-nav-actions.is-connected { gap: .65rem; min-height: 46px; padding: 0 .3rem 0 .75rem; border: 1px solid rgba(235,237,224,.36); background: rgba(12,14,13,.78); }
.dojo-home-link { color: var(--muted); font-size: .875rem; }
.dojo-home-link:hover { color: var(--paper); }
.dojo-connect { border: 1px solid rgba(235,237,224,.36); padding: .65rem 1rem; font-size: .875rem; white-space: nowrap; transition: border-color .2s; }
.dojo-connect:hover { border-color: var(--paper); }
.wallet-balance-chip { display: flex; align-items: center; gap: .4rem; padding: 0; white-space: nowrap; }
.wallet-coin-icon { width: 20px; height: 20px; flex: 0 0 20px; filter: invert(80%) sepia(42%) saturate(474%) hue-rotate(350deg) brightness(96%); }
.wallet-balance-chip .wallet-token { color: #d8d2c7; font-size: .75rem; letter-spacing: .04em; }
.wallet-balance-chip strong { color: #f1d794; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wallet-status-divider { width: 1px; height: 20px; margin-left: .3rem; background: rgba(235,237,224,.28); }
.dojo-nav-actions.is-connected .dojo-connect { padding: .65rem .3rem; border: 0; }
.dojo-nav-actions.is-connected .dojo-disconnect-icon { width: 38px; height: 38px; }
.eyebrow { font-size: .8125rem; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.label-rule { display: inline-block; width: 28px; height: 1px; background: currentColor; opacity: .65; }
.hub-view { min-height: calc(100svh - 105px); }
.hub-heading { position: fixed; left: max(4vw, calc((100vw - 1440px) / 2)); bottom: 2rem; pointer-events: none; }
.hub-heading h1 { font-family: var(--serif); font-size: clamp(2.5rem, 4vw, 4rem); line-height: 1; letter-spacing: -.045em; font-weight: 400; margin: 0 0 .6rem; }
.hub-heading .eyebrow { font-size: .875rem; color: #d0c6b4; }
.text-action { padding: .25rem 0; display: inline-flex; gap: 1rem; align-items: center; justify-content: space-between; font-size: .875rem; font-weight: 500; }
.dojo-disconnect-icon { width: 44px; height: 44px; padding: 0; justify-content: center; border: 1px solid transparent; transition: color .2s, border-color .2s, background .2s; }
.dojo-disconnect-icon:hover { color: var(--paper); border-color: var(--line); background: rgba(235,237,224,.05); }
.dojo-disconnect-icon svg { width: 19px; height: 19px; }
.text-action > span[aria-hidden] { font-size: 1.2rem; color: var(--accent-light); transition: transform .2s; }
.text-action:hover > span[aria-hidden] { transform: translate(2px, -2px); }
/* Door targets use the same fitted 16:9 canvas as the hub artwork and video. */
.hall-directory { position: fixed; left: 50%; top: 50svh; width: var(--hall-width); height: var(--hall-height); transform: translate(-50%, -50%); pointer-events: none; }
.dojo-hotspot { --door-accent: #e0b77c; --door-glow: rgba(224,183,124,.23); --door-seal: #503724; position: absolute; top: 35%; left: 50%; width: 16%; height: 31%; min-height: 44px; padding: 0; transform: translateX(-50%); pointer-events: auto; text-align: center; }
.dojo-hotspot[data-room-target="dungeon"] { --door-accent: #bdcd94; --door-glow: rgba(189,205,148,.2); --door-seal: #333d29; left: 24%; }
.dojo-hotspot[data-room-target="clans"] { --door-accent: #e89c7d; --door-glow: rgba(232,156,125,.22); --door-seal: #5a2c25; left: 78%; }
.destination-copy { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: 2.35rem minmax(0,1fr); align-items: center; gap: .7rem; width: clamp(12rem, 17vw, 16rem); min-height: 5.25rem; padding: .9rem 1rem; border: 1px solid #ab895a; border-bottom: 3px solid #735235; background: linear-gradient(135deg, #30291e, #181c17 68%); box-shadow: inset 0 1px rgba(255,230,178,.18), 0 4px 0 #10130f, 0 10px 22px rgba(0,0,0,.42); text-align: left; transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.destination-copy::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(201,164,107,.25); pointer-events: none; }
.destination-sigil { display: grid; place-items: center; width: 2.35rem; height: 2.65rem; border: 1px solid var(--door-accent); color: var(--door-accent); background: var(--door-seal); box-shadow: inset 0 0 0 3px rgba(10,14,10,.35); font-family: var(--serif); font-size: 1.5rem; line-height: 1; }
.destination-label { display: grid; gap: .3rem; min-width: 0; }
.destination-copy strong { color: #f4e3c4; font-family: var(--serif); font-weight: 400; font-size: clamp(1.125rem, 1.55vw, 1.4rem); line-height: 1.15; }
.destination-copy small { font-size: .875rem; line-height: 1.3; color: #c3baa6; }
.dojo-hotspot:hover .destination-copy,
.dojo-hotspot:focus-visible .destination-copy { transform: translate(-50%, -4px); border-color: var(--door-accent); box-shadow: inset 0 1px rgba(255,230,178,.25), 0 5px 0 #10130f, 0 0 24px var(--door-glow), 0 12px 26px rgba(0,0,0,.45); }
.dojo-hotspot:active .destination-copy { transform: translate(-50%, 0); box-shadow: inset 0 2px 5px rgba(0,0,0,.3), 0 2px 0 #10130f, 0 0 14px var(--door-glow); }
.dojo-hotspot:focus-visible { outline: 2px solid var(--door-accent); outline-offset: 6px; }
.room-view { padding: 2.7rem 0 3.5rem; min-height: calc(100svh - 105px); }
.room-masthead { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 2.4rem; }
.room-masthead h1 { font-family: var(--serif); font-size: clamp(2.8rem,4.3vw,4.25rem); font-weight: 400; line-height: 1.1; letter-spacing: -.045em; margin: .8rem 0 .6rem; }
.room-description { color: var(--muted); max-width: 640px; }
.room-back { margin-top: .4rem; color: var(--muted); white-space: nowrap; }
.training-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 1.75rem; align-items: start; }
.formation-panel { min-width: 0; padding: 1.5rem; border: 1px solid #555446; background: rgba(19,23,19,.94); box-shadow: 0 12px 35px rgba(0,0,0,.12); }
.section-heading { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 1.05rem; margin-bottom: 1.4rem; gap: 1rem; }
.section-heading h2 { font-size: 1rem; font-weight: 500; }
.section-heading h2 > span { margin-left: .65rem; color: var(--muted); font-size: .875rem; }
.formation-controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.15rem 0 1.25rem; }
.formation-controls button { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; padding: .5rem .85rem; color: #bfc1b5; border: 1px solid #484c40; font-size: .875rem; }
.formation-controls button > span { font-variant-numeric: tabular-nums; color: #ead3b3; }
.formation-controls button[aria-pressed="true"] { color: #f3e7d5; background: #393128; border-color: #a5815d; }
.formation-controls button:hover { border-color: #c4a27c; }
.formation-tools { display: inline-flex; gap: .5rem; margin-left: auto; }
.formation-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.15rem; }
.formation-hero { position: relative; min-width: 0; border: 1px solid #847050; background: #25291f; transition: border-color .25s, box-shadow .25s; }
.formation-hero:hover { border-color: #d4b685; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.hero-frame { position: relative; isolation: isolate; overflow: hidden; }
.formation-hero img { width: 100%; height: clamp(230px,25vw,350px); object-fit: cover; object-position: center 30%; transition: transform .45s; }
.formation-hero:hover img { transform: scale(1.025); }
.hero-status { position: absolute; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .65rem; background: rgba(16,21,16,.95); color: #f1e2c5; font-size: .875rem; }
.hero-status::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; background: #d9b67c; transform: rotate(45deg); }
.formation-hero.is-training { border-color: #a6b88d; background: #273023; box-shadow: inset 0 0 0 1px rgba(166,184,141,.15); }
.is-training .hero-status { color: #d6ebbe; }
.is-training .hero-status::before { background: #bad69d; }
.hero-training-lines { position: absolute; bottom: 18px; right: 17px; height: 21px; display: none; align-items: end; gap: 3px; padding: 3px; background: rgba(16,21,16,.95); }
.is-training .hero-training-lines { display: flex; }
.hero-training-lines i { width: 3px; height: 100%; background: #d1e5ab; transform-origin: bottom; animation: training-rhythm 1.35s ease-in-out infinite; }
.hero-training-lines i:nth-child(2) { animation-delay: -.45s; }
.hero-training-lines i:nth-child(3) { animation-delay: -.9s; }
.formation-hero figcaption { display: flex; align-items: center; justify-content: space-between; gap: .25rem; padding: .8rem .9rem .4rem; border-top: 1px solid #6d614a; }
.formation-hero figcaption div { display: grid; gap: .1rem; }
.formation-hero figcaption small { color: #c2c5b6; font-size: .875rem; }
.formation-hero figcaption strong { font-size: 1.125rem; font-weight: 500; }
.formation-remove { font-size: .875rem; min-width: 44px; min-height: 44px; padding-inline: .3rem; color: #e1d3ba; flex-shrink: 0; }
.formation-remove:hover { color: var(--accent-light); }
.hero-training-note { padding: 0 .9rem .9rem; font-size: .875rem; color: #bfc2b2; }
.is-training .hero-training-note { color: #c5dcad; }
.training-command { margin-top: 1.35rem; border-top: 1px solid #5b5846; padding-top: 1.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.25rem 2rem; }
.training-selection-summary { min-width: 0; }
#training-action-copy { display: block; color: #f1e7d5; font-size: 1.125rem; font-weight: 500; line-height: 1.4; }
.training-terms { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: .9rem; }
.training-terms > div { display: grid; gap: .2rem; }
.training-terms dt { color: #bfc2b5; font-size: .8125rem; }
.training-terms dd { color: #ead8b7; font-size: 1.125rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.training-terms dd span { font-size: .8125rem; font-weight: 400; }
#training-action-hint { grid-column: 1 / -1; display: block; color: #bfc2b5; font-size: .8125rem; line-height: 1.65; white-space: pre-line; }
.training-command .training-start { background: #b64935; color: #fff8ed; border: 1px solid #db8564; box-shadow: inset 0 1px rgba(255,236,206,.16), 0 4px 0 #542a23; }
.training-command .training-start:hover:not(:disabled) { background: #cb5740; }
.training-command .training-start:disabled { opacity: 1; background: #30372c; border-color: #59624e; color: #c7d2ba; box-shadow: none; }
.formation-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; border: 1px dashed var(--line); text-align: center; padding: 2rem; }
.formation-empty > span { font-family: var(--serif); font-size: 2.5rem; color: var(--accent-light); }
.formation-empty h3 { font: 400 1.7rem var(--serif); }
.formation-empty p { color: var(--muted); }
.training-ledger { padding: 1.5rem; background: linear-gradient(150deg, #302e24, #1b211b 45%); border: 1px solid #8b795c; border-top: 3px solid #c3a371; box-shadow: 0 12px 35px rgba(0,0,0,.16); align-self: start; min-width: 0; }
.reward-title { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.reward-title .eyebrow { font-size: .875rem; letter-spacing: .06em; color: #e0caa9; }
.reward-lock-label { color: #d5c6ae; font-size: .875rem; }
.training-ledger h2 { margin: .9rem 0 1.35rem; font: 400 2rem/1.15 var(--serif); letter-spacing: -.03em; }
.claim-dial { --cycle-progress: 0%; width: min(210px,100%); aspect-ratio: 1; padding: 7px; margin: 0 auto; border: 1px solid #8b795c; border-radius: 50%; background: conic-gradient(from -90deg, #ddbe81 var(--cycle-progress), #484b3b 0); box-shadow: 0 0 0 7px rgba(193,164,112,.045); }
.claim-dial-inner { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #716549; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #32382a, #1d231b 75%); text-align: center; padding: .75rem; }
#claim-dial-label { font-size: .875rem; color: #d9c8a9; }
#claim-dial-value { color: #f4e4be; font-family: var(--serif); font-size: 4.8rem; letter-spacing: -.06em; font-weight: 400; line-height: 1.08; font-variant-numeric: tabular-nums; }
#claim-dial-unit { font-size: .875rem; color: #c4c9b8; font-variant-numeric: tabular-nums; }
.claim-clock { min-height: 3em; text-align: center; font-size: .875rem; color: #d0d3c3; font-variant-numeric: tabular-nums; margin: 1.2rem 0 .65rem; }
.claim-milestones { list-style: none; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .35rem; padding: 0; margin: 0 0 .7rem; }
.claim-milestones li { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; }
.claim-milestones span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #6e705a; color: #c6c7b6; font-size: .875rem; font-variant-numeric: tabular-nums; background: #262d23; }
.claim-milestones small { color: #c1c5b6; font-size: .875rem; }
.claim-milestones .is-current span { border-color: #d7b57a; color: #f5dfb6; background: #514530; box-shadow: 0 0 12px rgba(215,181,122,.12); }
.claim-milestones .is-complete span { border-color: #adc18b; color: #dfefc6; background: #3b4a2d; }
.claim-track { height: 5px; background: #494d3b; margin-bottom: 1.15rem; }
#claim-track-fill { display: block; height: 100%; width: 0; background: #dfbf83; transition: width .4s; }
.ledger-lines > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.ledger-lines dt { color: var(--muted); }
.ledger-lines dd { text-align: right; }
.reward-summary { padding: 1.7rem 0; }
.reward-summary > span { font-size: .875rem; color: var(--muted); }
.reward-summary p { margin-top: .4rem; font-size: 2.5rem; line-height: 1.2; }
.reward-summary small { font-size: .875rem; color: var(--muted); margin-left: .4rem; }
.training-ledger .reward-summary { padding: 1.25rem 0; }
.training-ledger .reward-summary > small { display: block; margin: .45rem 0 0; }
.button-primary, .button-outline { display: inline-flex; min-height: 48px; padding: .85rem 1.4rem; align-items: center; justify-content: center; gap: 1.5rem; font-size: .9375rem; font-weight: 500; transition: background .2s, border-color .2s; }
.button-primary { background: var(--paper); color: #181b17; }
.button-primary:hover:not(:disabled) { background: #dcd5c6; }
.button-outline { border: 1px solid #686c61; }
.button-outline:hover { border-color: var(--paper); }
.training-ledger .button-primary { width: 100%; }
.availability-note { font-size: .8125rem; color: var(--muted); text-align: center; margin-top: .9rem; }
.training-ledger .claim-button:disabled { opacity: 1; color: #c2c8b9; background: #363e30; border: 1px solid #677055; }
.training-ledger .availability-note { font-size: .875rem; }
.training-rules { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5rem; padding: 1.5rem 0 .25rem; border-top: 1px solid #625c48; }
.training-rules > div { display: flex; align-items: flex-start; gap: .85rem; }
.training-rules > div > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border: 1px solid #9a8060; background: rgba(25,28,22,.95); color: #e1c8a1; font-size: .875rem; }
.training-rules strong { display: block; font-size: 1rem; font-weight: 500; margin-bottom: .25rem; }
.training-rules p { font-size: .875rem; color: #c1c6b7; }
.training-announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.clan-choices { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; max-width: 1240px; margin-inline: auto; }
.clan-banner { --clan-color: #d2b67e; position: relative; isolation: isolate; min-width: 0; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(222,213,190,.25); background: #111615; box-shadow: 0 18px 45px rgba(0,0,0,.22); }
.clan-banner[data-clan="Azure Dragon"] { --clan-color: #8db8d8; }
.clan-banner[data-clan="Black Tortoise"] { --clan-color: #a7bc8a; }
.clan-banner[data-clan="Vermillion Bird"] { --clan-color: #e28b6b; }
.clan-banner[data-clan="White Tiger"] { --clan-color: #e2ddd0; }
.clan-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: -2; opacity: .9; }
.clan-banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,rgba(8,11,10,.75),transparent 55%),linear-gradient(180deg,transparent 40%,rgba(7,10,9,.93)); }
.clan-banner::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--clan-color); opacity: .8; }
.clan-kanji { position: absolute; top: 1rem; right: 1rem; padding: .35rem .55rem; border: 1px solid rgba(223,216,198,.45); background: rgba(9,13,12,.72); color: var(--clan-color); font-family: var(--serif); font-size: 1rem; letter-spacing: .12em; }
.clan-banner-copy { position: absolute; left: 1.35rem; right: 1.35rem; bottom: 1.25rem; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: .45rem 1.35rem; }
.clan-identity { display: grid; gap: .3rem; min-width: 0; }
.clan-identity small, .clan-score small { color: #d2d4cb; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.clan-identity strong { font-family: var(--serif); font-size: clamp(1.55rem,2.7vw,2.4rem); font-weight: 400; line-height: 1; letter-spacing: -.025em; }
.clan-score { display: grid; justify-items: end; min-width: 120px; padding-left: 1.2rem; border-left: 1px solid rgba(225,217,196,.25); }
.clan-score b { color: var(--clan-color); font-size: clamp(1.8rem,3vw,2.8rem); font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.clan-update { grid-column: 1 / -1; color: #e2cf9b; font-size: .8125rem; }
.clan-points-note { max-width: 1240px; margin: 1rem auto 0; color: #bcc2b7; font-size: .875rem; line-height: 1.6; }
.pets-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(310px,1fr); gap: 3rem; align-items: stretch; }
.dungeon-window { position: relative; min-height: 440px; overflow: hidden; background: #0a100c; }
.dungeon-window > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% center; }
.dungeon-window figcaption { position: absolute; inset: auto 1.3rem 1.2rem; display: flex; justify-content: space-between; gap: 1rem; font-size: .8125rem; color: #d4d9ca; }
.dungeon-window figcaption span:last-child { font-size: 1.1rem; }
.dungeon-window.is-listening > img { animation: gate-breath 1.5s ease-in-out; }
.companion-journal { padding: 1rem 0; align-self: center; }
.sealed-label { color: #d5b9a5; border: 1px solid #6b5749; font-size: .75rem; letter-spacing: .04em; padding: .15rem .5rem; }
.companion-journal h2 { font: 400 clamp(2rem,3.2vw,3rem)/1.13 var(--serif); letter-spacing: -.04em; margin: 1.25rem 0; }
.companion-copy { color: var(--muted); max-width: 440px; margin-bottom: 1rem; }
.companion-journal .button-outline { margin-top: 1.75rem; width: 100%; justify-content: space-between; }
.dungeon-response { font-size: .875rem; color: var(--muted); margin-top: 1rem; min-height: 2.5em; }
.inventory-drawer { color: var(--paper); background: #171a17; border: 1px solid #626658; max-width: 1050px; width: calc(100% - 3rem); max-height: calc(100svh - 3rem); padding: 0; overscroll-behavior: contain; }
.inventory-drawer::backdrop { background: rgba(5,8,6,.85); }
body:has(.inventory-drawer[open]) { overflow: hidden; }
.drawer-panel { padding: 2rem; }
.drawer-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.drawer-header h2 { font: 400 2.5rem/1.15 var(--serif); letter-spacing: -.04em; margin: .8rem 0 .5rem; }
.drawer-header p:not(.eyebrow) { color: var(--muted); }
.drawer-close { font-size: 1.8rem; min-width: 44px; height: 44px; border: 1px solid var(--line); }
.inventory-toolbar { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 1.8rem 0 1rem; margin-bottom: 1.3rem; font-size: .875rem; }
.inventory-toolbar b { color: var(--muted); font-weight: 400; margin-left: .5rem; }
.inventory-toolbar p { color: var(--muted); }
.inventory-toolbar strong { color: var(--paper); font-weight: 500; }
.nft-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.nft-card { position: relative; padding: 0; text-align: left; border: 1px solid transparent; background: #23261f; }
.nft-card[aria-pressed="true"] { border-color: var(--accent-light); }
.nft-image img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; }
.nft-copy { display: grid; padding: .85rem; gap: .15rem; }
.nft-copy small { color: var(--muted); font-size: .75rem; }
.nft-copy strong { font-size: 1rem; font-weight: 500; }
.nft-check { position: absolute; top: .6rem; right: .6rem; display: grid; place-content: center; width: 24px; height: 24px; background: rgba(17,19,18,.85); border: 1px solid #aeaa97; color: transparent; }
.nft-card[aria-pressed="true"] .nft-check { color: #fff; border-color: var(--accent); background: var(--accent); }
.drawer-footer { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.8rem; }
.drawer-footer p { font-size: .8125rem; color: var(--muted); }
.dojo-toast { position: fixed; bottom: 1.5rem; left: 50%; width: max-content; max-width: calc(100% - 2rem); transform: translate(-50%, 12px); background: #eeeee6; color: #171b16; border-left: 3px solid var(--accent); padding: 1rem 1.3rem; font-size: .875rem; opacity: 0; visibility: hidden; transition: .2s; z-index: 60; }
.dojo-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%,0); }
.room-transition { position: fixed; inset: 0; z-index: 45; background: #101410; display: grid; place-content: center; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility .2s; }
.room-transition span { font: 400 2rem var(--serif); }
.is-room-transitioning .room-transition { opacity: .96; visibility: visible; }
.dojo-entry { position: fixed; inset: 0; display: grid; place-items: center; z-index: 20; }
.dojo-enter-trigger { width: min(760px,90vw); padding: 1rem; }
.dojo-title-banner { width: 100%; height: auto; filter: drop-shadow(0 8px 30px rgba(0,0,0,.35)); transition: transform .3s; }
.dojo-enter-trigger:hover .dojo-title-banner { transform: translateY(-3px); }
.dojo-enter-prompt { display: block; margin-top: 1rem; font-size: .875rem; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 2px 6px #000; }
.dojo-app.is-entered .dojo-entry, .dojo-app.is-opening .dojo-entry { display: none; }
.dojo-opening { position: fixed; inset: 0; z-index: 40; opacity: 0; visibility: hidden; pointer-events: none; background: #111512; }
.dojo-app.is-opening .dojo-opening { opacity: 1; visibility: visible; pointer-events: auto; }
.dojo-opening-video { width: 100%; height: 100%; object-fit: cover; transition: opacity .7s ease; }
.dojo-app.is-opening-complete .dojo-opening { background: transparent; pointer-events: none; }
.dojo-app.is-opening-complete .dojo-opening-video { opacity: 0; }
.is-opening-complete .dojo-opening-skip { visibility: hidden; }
.dojo-opening-skip { position: absolute; right: 2rem; bottom: 2rem; padding: .7rem 1rem; font-size: .875rem; background: rgba(10,13,11,.8); border: 1px solid #a5ac98; }
.dojo-opening-skip span { font-size: .75rem; color: #b9c1ad; margin-left: 1rem; }
.dojo-app:not(.is-entered) .dojo-topbar,
.dojo-app:not(.is-entered) .dojo-playfield,
.dojo-app:not(.is-entered) .dojo-hotspot { visibility: hidden; }
.dojo-app.is-intro-revealing .dojo-topbar { animation: reveal .7s both; }
.dojo-app.is-intro-revealing .hub-view { animation: hall-reveal .8s .15s both; }
.noscript-note { position: fixed; inset: auto 1rem 2rem; z-index: 50; text-align: center; padding: 1rem; background: var(--ink); }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes hall-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes gate-breath { 50% { filter: brightness(1.32); transform: scale(1.015); } }
@keyframes training-rhythm { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@media (max-width: 1120px) {
  .dojo-topbar { flex-wrap: wrap; gap: 0; padding-top: 1rem; }
  .dojo-brand { order: 0; }
  .dojo-nav-actions { order: 1; margin-left: auto; }
  .room-game-nav { order: 2; flex-basis: 100%; height: 62px; justify-content: center; gap: 3rem; }
  .hub-view, .room-view { min-height: calc(100svh - 140px); }
  .training-layout { gap: 1.25rem; grid-template-columns: minmax(0,1fr) 310px; }
  .formation-panel { padding: 1.15rem; }
  .training-command { grid-template-columns: 1fr; }
  .training-start { width: 100%; justify-content: space-between; }
  .hero-status { left: 10px; bottom: 10px; font-size: .875rem; padding-inline: .45rem; }
  .hero-training-lines { display: none !important; }
  .formation-hero figcaption { flex-wrap: wrap; }
  .formation-remove { margin-left: auto; }
  .training-ledger { padding: 1.25rem; }
  .pets-layout { gap: 2rem; }
}
@media (max-width: 760px) {
  .dojo-brand img { width: 80px; height: 44px; }
  .dojo-brand { gap: .8rem; }
  .dojo-wordmark strong { font-size: .875rem; }
  .dojo-nav-actions { gap: 1rem; }
  .dojo-home-link { display: none; }
  .dojo-connect { padding: .6rem .7rem; }
  .room-game-nav { gap: 1.35rem; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .room-game-nav::-webkit-scrollbar { display: none; }
  .room-game-nav button, .room-game-nav > a { min-height: 52px; flex: 0 0 auto; }
  .hub-heading { left: 1.25rem; bottom: 1.5rem; }
  .destination-copy { grid-template-columns: minmax(0,1fr); justify-items: center; gap: .45rem; min-width: 0; width: clamp(5rem, 24vw, 11rem); min-height: 6.25rem; padding: .65rem .3rem; text-align: center; }
  .destination-sigil { width: 1.8rem; height: 2rem; font-size: 1.25rem; }
  .destination-copy strong { font-size: .9375rem; line-height: 1.15; }
  .destination-copy small { display: none; }
  .room-view { padding: 2rem 0; }
  .room-masthead { flex-wrap: wrap; gap: .8rem; margin-bottom: 1.8rem; }
  .room-back { font-size: .875rem; }
  .training-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .formation-panel { padding: 1rem; }
  .formation-panel .section-heading { flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
  .formation-grid { gap: .85rem; }
  .formation-hero img { height: auto; aspect-ratio: .9; }
  .formation-hero figcaption { padding: .65rem; }
  .hero-training-note { padding: 0 .65rem .75rem; }
  .training-ledger { padding: 1.5rem; }
  .training-rules { grid-template-columns: 1fr; gap: 1.25rem; }
  .clan-choices { grid-template-columns: 1fr; gap: .85rem; }
  .clan-banner { aspect-ratio: 16 / 9; }
  .pets-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .dungeon-window { min-height: 300px; height: 320px; }
  .companion-journal { padding: .25rem 0; }
  .companion-journal h2 { font-size: 2.5rem; }
  .inventory-drawer { width: calc(100% - 1.5rem); max-height: calc(100svh - 1.5rem); }
  .drawer-panel { padding: 1.25rem; }
  .drawer-header h2 { font-size: 2rem; }
  .drawer-header .eyebrow { font-size: .75rem; }
  .nft-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
  .drawer-footer { flex-direction: column; align-items: stretch; gap: 1rem; }
  .dojo-opening-skip { right: 1.25rem; bottom: 1.25rem; }
}
@media (max-width: 460px) {
  .formation-grid { grid-template-columns: 1fr; }
  .formation-hero img { aspect-ratio: 1; }
  .formation-hero figcaption { flex-wrap: nowrap; }
  .formation-controls button { flex: 1 1 auto; justify-content: center; padding-inline: .65rem; }
  .formation-tools { flex-basis: 100%; margin-left: 0; }
  .formation-tools button { flex: 1; }
  .clan-banner { aspect-ratio: 4 / 3; }
  .clan-banner-copy { grid-template-columns: 1fr; }
  .clan-score { justify-items: start; min-width: 0; padding: 0; border-left: 0; }
}
@media (max-width: 380px) {
  .dojo-app { padding-inline: 1rem; }
  .clan-banner-copy { left: 1rem; right: 1rem; bottom: 1rem; gap: .35rem .8rem; }
  .clan-score { min-width: 0; padding-left: 0; }
}
@media (max-aspect-ratio: 4/3) {
  .dojo-app { --hall-width: 100vw; --hall-height: 56.25vw; }
  .dojo-app.is-entered[data-room="hub"] .dojo-scene-shade { background: linear-gradient(180deg, rgba(10,13,12,.75), transparent 32%, transparent 65%, rgba(10,13,12,.7)); }
}
@media (min-aspect-ratio: 5/2) {
  .dojo-app { --hall-width: 177.777778svh; --hall-height: 100svh; }
  .hub-heading { bottom: 1rem; }
  .hub-heading h1 { font-size: 2rem; }
  .hub-heading .eyebrow { display: none; }
}
@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  .destination-copy { grid-template-columns: 1.5rem minmax(0,1fr); gap: .35rem; min-height: 4rem; padding: .5rem .3rem; }
  .destination-sigil { width: 1.5rem; height: 1.85rem; font-size: 1.125rem; }
  .destination-copy strong { font-size: clamp(.875rem, 1.7vw, 1.125rem); }
  .destination-copy small { display: none; }
  .hub-heading { bottom: .5rem; }
  .hub-heading h1 { font-size: 1.25rem; margin: 0; }
  .hub-heading .eyebrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .dojo-scene-video { display: none; }
}
