@import url('./ui-match.css');
@import url('./ui-dialogs.css');
@import url('./onboarding.css');
@import url('./typography.css');

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #243d31; background: #f7f8f3; font-synthesis: none; color-scheme: light;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --ink: #243d31; --green: #37694c; --blue: #3e6454;
  --paper: #f7f8f3; --line: #d9dfd4; --muted: #647268; --lime: #dce7cd;
  --header-height: 72px; --menu-width: 40%;
}
* { box-sizing: border-box; }
/* Home-screen landscape puts the island on one side only; older iOS builds also
   report the island side as 0. Mirror the larger inset so left and right
   rotations get identical clearance instead of exposing one edge. */
@media (orientation: landscape) {
  :root { --safe-left: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); --safe-right: var(--safe-left); }
}
@media (display-mode: standalone) and (orientation: landscape) and (min-aspect-ratio: 2/1) {
  :root { --safe-left: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px), 62px); --safe-right: var(--safe-left); }
}
/* Keep the responsive type scale stable when iOS rotates the viewport. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
html,body { margin:0; width:100%; height:100vh; height:100dvh; overflow:hidden; overscroll-behavior:none; }
body { background: var(--paper); touch-action:manipulation; -webkit-user-select:none; user-select:none; }
body[data-screen=match],body[data-screen=match] * { -webkit-touch-callout:none; }
button,input { font:inherit; }
button { cursor:pointer; border:0; color:inherit; -webkit-tap-highlight-color:transparent; }
button,a,input { outline-offset:4px; }
button:focus-visible,a:focus-visible,input:focus-visible { outline:3px solid var(--blue); }
button:disabled { opacity:.45; cursor:default; }
[hidden] { display:none!important; }
a { color:inherit; text-decoration:none; }
input,textarea,[contenteditable=true] { -webkit-user-select:text; user-select:text; touch-action:manipulation; -webkit-touch-callout:default!important; }
input[type=range] { -webkit-user-select:none; user-select:none; touch-action:none; -webkit-touch-callout:none!important; }
button,a { transition:background-color .16s,color .16s,border-color .16s,box-shadow .16s; }
#court { position:fixed; inset:0; display:block; width:100vw; height:100dvh; touch-action:none; }
.screen-vignette { position:fixed; inset:0; pointer-events:none; background:linear-gradient(#061c2426,transparent 24%,transparent 82%,#061c2426); }
.topbar { position:fixed; inset:0 0 auto; z-index:6; height:var(--header-height); padding:0 max(32px,var(--safe-right)) 0 max(32px,var(--safe-left)); display:flex; align-items:center; gap:26px; background:white; border-bottom:1px solid var(--line); }
.brand { display:inline-flex; align-items:center; gap:10px; font-size:24px; line-height:1; font-weight:850; letter-spacing:1px; flex:0 0 auto; }
.brand-mark { display:grid; place-items:center; width:42px; height:42px; color:white; background:var(--green); border-bottom:5px solid var(--blue); }
.brand-mark svg { width:34px; height:34px; }
.brand small { display:block; font-size:9px; letter-spacing:3px; margin-top:6px; color:var(--green); }
.edition { display:flex; align-items:center; gap:14px; font-size:11px; letter-spacing:1.6px; color:var(--muted); }
.edition i { width:1px; height:14px; background:var(--line); }
.top-actions { display:flex; gap:8px; margin-left:auto; }
.icon-btn { width:36px; height:36px; background:transparent; border:1px solid var(--line); border-radius:4px; font-size:20px; display:grid; place-items:center; }
.icon-btn:hover { background:#eaf4ee; border-color:var(--green); }
.icon-btn:active { background:#dceee3; }
.icon-btn svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.icon-btn .sound-off { display:none; }
.icon-btn[data-muted=true] .sound-on { display:none; }
.icon-btn[data-muted=true] .sound-off { display:block; }
.eyebrow { display:flex; align-items:center; gap:9px; font-size:10px; line-height:1.5; letter-spacing:1.8px; font-weight:750; color:var(--green); }
.eyebrow>span { width:18px; height:3px; background:var(--green); }
button:where(.primary-btn,.secondary-btn) { width:100%; min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 18px; border-radius:3px; font-size:14px; font-weight:750; line-height:1.5; }
button:where(.primary-btn) { background:var(--green); color:white; border:1px solid var(--green); }
button:where(.secondary-btn) { background:white; color:var(--blue); border:1px solid var(--blue); }
:where(.primary-btn):hover { background:#006e41; }
:where(.secondary-btn):hover { background:#edf4fc; }
:where(.primary-btn,.secondary-btn)>span { font-size:18px; font-weight:600; }
:where(.text-btn) { display:block; background:transparent; color:var(--muted); padding:12px; margin:6px auto 0; font-size:13px; text-decoration:underline; text-underline-offset:4px; }

/* Separate the lobby setup from the live court. Match canvas stays full-screen. */
body[data-screen=menu] #court { left:var(--menu-width); top:var(--header-height); width:calc(100vw - var(--menu-width)); height:calc(100dvh - var(--header-height)); }
body[data-screen=menu] .screen-vignette { left:var(--menu-width); top:var(--header-height); background:linear-gradient(180deg,#071b3060,transparent 28%,transparent 55%,#05251bb3); }
.menu-panel { position:fixed; z-index:3; inset:var(--header-height) auto 0 0; width:var(--menu-width); padding:clamp(24px,3.2vw,48px) clamp(24px,3.6vw,56px) 20px; background:var(--paper); display:flex; flex-direction:column; min-height:0; }
.menu-heading { flex:0 0 auto; }
.menu-panel h1 { font-size:clamp(42px,4.5vw,70px); font-weight:900; letter-spacing:-2px; line-height:1.08; margin:17px 0 16px; }
.menu-panel h1>span { color:var(--green); }
.intro { font-size:14px; line-height:1.7; color:var(--muted); margin:0 0 26px; }
.setup { display:flex; flex-direction:column; flex:1; min-height:0; }
.setup-fields { flex:1; min-height:0; overflow-y:auto; padding:0 5px 0 0; touch-action:pan-y; scrollbar-width:thin; scrollbar-color:#becfc3 transparent; overscroll-behavior:contain; }
.section-label { display:flex; align-items:center; gap:10px; font-size:12px; margin:0 0 12px; font-weight:700; }
.section-label b { font-family:"Arial Narrow",Arial,sans-serif; font-size:13px; color:var(--green); border-top:2px solid var(--green); padding-top:4px; }
.role-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.role-card { position:relative; text-align:left; padding:13px 12px; background:white; border:1px solid var(--line); border-radius:3px; }
.role-card.selected { background:var(--green); border-color:var(--green); color:white; box-shadow:inset 0 -4px 0 #006d42; }
.role-card.selected::after { content:'✓'; position:absolute; right:8px; top:7px; font-size:11px; }
.role-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.role-icon { display:block; font-size:23px; height:27px; font-weight:500; }
.role-card strong { display:block; font-size:13px; margin:6px 0 3px; }
.role-card small { display:block; font-size:11px; opacity:.75; }
.role-note { min-height:32px; margin:10px 0 18px; font-size:11px; line-height:1.6; color:var(--muted); }
.entry-heading { flex:0 0 auto; margin-bottom:14px; }
.entry-heading h2 { margin:8px 0; font-size:26px; }
.entry-heading p { color:var(--muted); font-size:12px; line-height:1.6; }
.entry-content { flex:1; min-height:0; overflow-y:auto; touch-action:pan-y; padding:0 4px 8px 0; }
.entry-content .primary-btn { width:100%; margin-top:14px; }
.format-choices { flex-wrap:wrap; }.format-choices button { flex:1 0 40%; }
.lobby-players { white-space:pre-line; margin:16px 0; font-size:14px; line-height:1.8; }
.menu-panel[data-entry="home"] .setup { justify-content:center; }
.menu-panel[data-entry="home"] .menu-tip-compact { display:none; }
.friend-setup .room-mode-picker { margin-top:12px; }
.friend-setup input { display:block; width:100%; min-width:0; min-height:44px; padding:10px 12px; border:1px solid #bac9c0; border-radius:4px; background:white; font-size:16px; user-select:text; }
.friend-setup .input-label { display:block; font-size:12px; margin:14px 0 6px; }
.friend-setup .join-row { display:grid; grid-template-columns:1fr auto; gap:8px; margin-top:14px; }
.friend-setup .join-row .secondary-btn { margin:0; }
.friend-setup .dialog-foot { display:block; margin-top:10px; color:var(--muted); font-size:11px; line-height:1.6; }
.friend-setup #friend-modes button[aria-pressed="true"] { background:var(--green); color:white; }
.dialog#waiting-dialog #waiting-rules,.dialog#waiting-dialog #waiting-consent,.dialog#waiting-dialog #waiting-status { display:block; }
.setup-row { display:grid; grid-template-columns:70px minmax(0,1fr); align-items:center; gap:10px; padding:8px 0; border-top:1px solid var(--line); }
.field-label { font-size:12px; font-weight:650; white-space:nowrap; }
.segments { display:flex; padding:3px; background:#e8ede7; border-radius:3px; gap:2px; min-width:0; }
.segments button { flex:1; min-width:0; min-height:32px; padding:5px 6px; font-size:12px; white-space:nowrap; color:#61736a; background:transparent; border-radius:2px; }
.segments button.selected { background:white; color:var(--green); font-weight:750; box-shadow:0 1px 3px #133d2012; }
#targets[aria-disabled=true] { opacity:.45; }
.rules-note { font-size:11px; color:var(--muted); line-height:1.6; min-height:18px; margin:6px 0 10px; }
.launch-actions { flex:0 0 auto; display:grid; gap:8px; padding-top:14px; background:var(--paper); }
.launch-actions .primary-btn { min-height:52px; }
.launch-actions .secondary-btn>span { font-size:12px; letter-spacing:1px; }
.menu-tip-compact { display:none; }
.menu-foot { display:flex; justify-content:space-between; gap:8px; flex:0 0 auto; color:var(--muted); font-size:10px; margin-top:16px; line-height:1.5; }
.menu-foot { flex-direction:column; align-items:stretch; text-align:right; }
.menu-foot-actions {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,88px),1fr));
  gap:6px;
  width:min(100%,232px);
  margin-inline:auto;
}
/* Keep the label on one line and opt these controls out of mobile text inflation. */
.menu-foot-actions .secondary-btn {
  min-width:0;
  height:44px;
  min-height:44px;
  justify-content:center;
  padding:0 4px;
  font-size:11px;
  line-height:16px;
  white-space:nowrap;
  -webkit-text-size-adjust:none;
  text-size-adjust:none;
}
.leaderboard-entry { flex:0 0 auto; margin:-5px 0; padding:5px 4px; background:transparent; color:var(--green); font-size:inherit; font-weight:750; line-height:inherit; white-space:nowrap; }
.leaderboard-entry:hover { background:#e8ede7; }
.court-caption { position:fixed; inset:var(--header-height) 0 0 var(--menu-width); pointer-events:none; color:white; overflow:hidden; }
.live-tag { position:absolute; left:28px; top:24px; display:flex; align-items:center; gap:8px; font-size:10px; letter-spacing:1.6px; font-weight:700; }
.live-tag i { display:block; width:6px; height:6px; border-radius:50%; background:#bce85a; }
.live-tag span { color:#bbd6cc; font-size:11px; letter-spacing:0; font-weight:400; margin-left:6px; }
.court-poster { position:absolute; right:32px; bottom:92px; text-align:right; }
.court-poster>span { font-size:10px; letter-spacing:2px; color:#c7e8d9; }
.court-poster strong { display:block; font-size:clamp(26px,3.1vw,48px); font-weight:850; line-height:1.3; letter-spacing:-1px; margin-top:10px; text-shadow:0 2px 18px #0b2d2570; }
.court-strip { position:absolute; bottom:0; left:0; right:0; min-height:56px; padding:12px 28px; display:flex; align-items:center; gap:16px; background:var(--green); border-left:7px solid var(--blue); }
.court-strip b { font:italic 800 30px/1 "Arial Narrow",Arial,sans-serif; }
.court-strip span { font-size:12px; }
.court-strip span:last-child { margin-left:auto; font-size:9px; letter-spacing:1.4px; opacity:.8; }

@media (max-height:760px) and (orientation:landscape) {
  :root { --header-height:60px; --menu-width:41%; }
  .menu-panel { padding:22px 32px 12px; }
  .menu-panel h1 { font-size:44px; margin:10px 0; }
  .intro { font-size:12px; margin-bottom:18px; }
  .role-card { padding:9px 10px; }.role-icon { font-size:20px; height:21px; }
  .role-note { margin:8px 0 10px; min-height:18px; }.setup-row { padding:6px 0; }
  .launch-actions { padding-top:10px; }.launch-actions .primary-btn { min-height:46px; }
  .launch-actions .secondary-btn { min-height:44px; padding:10px 16px; }.menu-foot { margin-top:10px; }
}
@media (max-height:500px) and (orientation:landscape) {
  :root { --header-height:46px; --menu-width:44%; }
  .topbar { padding:0 max(16px,var(--safe-right)) 0 max(16px,var(--safe-left)); }
  .brand { font-size:19px; gap:7px; }.brand-mark { width:30px; height:30px; border-bottom-width:3px; }
  .brand-mark svg { width:26px; height:26px; }.brand small { font-size:7px; margin-top:4px; }
  .edition { font-size:10px; }.icon-btn { width:32px; height:32px; }
  .menu-panel { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto minmax(0,1fr) auto; column-gap:8px; padding:10px 16px max(7px,var(--safe-bottom)); padding-left:max(16px,var(--safe-left)); }.menu-panel .eyebrow,.intro { display:none; }
  .menu-heading,.setup,.menu-panel .entry-heading,.menu-panel>.entry-content { grid-column:1/-1; min-width:0; }
  .menu-panel .entry-heading { margin-bottom:6px; }
  .menu-panel .entry-heading h2 { font-size:22px; margin:5px 0; }
  .menu-panel .entry-heading p { font-size:11px; margin:4px 0; }
  .menu-panel h1 { font-size:26px; margin:0 0 8px; letter-spacing:-1px; }.menu-panel h1 br { display:none; }
  .section-label { margin-bottom:6px; font-size:11px; line-height:1.4; }.section-label b { display:none; }
  .role-grid { gap:5px; }
  .role-card { min-width:0; padding:5px; min-height:44px; text-align:center; line-height:1.25; }
  .role-icon { display:none; }
  .role-card strong { font-size:12px; margin:0 0 2px; white-space:nowrap; }.role-card small { font-size:10px; white-space:nowrap; }.role-card.selected::after { display:none; }
  .role-note { font-size:10px; margin:6px 0 8px; }
  .setup-row { grid-template-columns:64px minmax(0,1fr); gap:4px; padding:5px 0; }
  .segments button { min-height:29px; font-size:11px; padding:4px 2px; }.field-label { font-size:11px; }
  .rules-note { font-size:10px; margin:4px 0; }.launch-actions { grid-template-columns:repeat(2,minmax(0,1fr)); padding:5px 0; gap:6px; }
  .launch-actions .primary-btn,.launch-actions .secondary-btn { min-width:0; min-height:44px; padding:8px; gap:4px; font-size:12px; line-height:1.25; white-space:nowrap; }
  .launch-actions .primary-btn>span { font-size:16px; }.launch-actions .secondary-btn>span { font-size:10px; letter-spacing:0; }
  .menu-panel>.pwa-entry { min-width:0; min-height:26px; padding:4px 0; border:0; font-size:10px; }
  .menu-panel>.pwa-entry small { display:none; }
  .menu-panel:not([data-entry="home"]) .menu-foot-actions { display:none !important; }
  .menu-foot { margin-top:0; gap:2px; font-size:9px; }
  .menu-tip-desktop { display:none; }.menu-tip-compact { display:block; flex:0 0 auto; padding-top:4px; color:var(--green); font-size:10px; font-weight:650; line-height:14px; }
  .live-tag { top:15px; left:20px; }.court-poster { bottom:59px; right:20px; }
  .court-poster strong { font-size:24px; margin-top:5px; }.court-poster>span { font-size:8px; }
  .court-strip { min-height:38px; padding:8px 16px; gap:12px; }.court-strip b { font-size:22px; }
  .court-strip span { font-size:10px; }.court-strip span:last-child { display:none; }
}
@media (max-height:360px) and (orientation:landscape) {
  :root { --header-height:42px; --menu-width:46%; }.edition { display:none; }
  .menu-panel { padding-top:7px; padding-right:14px; padding-left:max(14px,var(--safe-left)); }.menu-panel h1 { font-size:24px; margin-bottom:6px; }
  .section-label,.role-note { display:none; }.role-grid { margin-bottom:7px; }.court-poster strong { font-size:22px; }
}
@media (orientation:portrait) {
  :root { --header-height:64px; --menu-width:100%; }
  .topbar { padding:0 max(16px,var(--safe-right)) 0 max(16px,var(--safe-left)); gap:12px; }
  .edition { display:none; }.top-actions { gap:5px; }.brand { font-size:22px; }
  .brand-mark { width:36px; height:36px; }.icon-btn { width:32px; height:32px; }
  body[data-screen=menu] #court { left:0; top:0; width:100vw; height:100dvh; }
  body[data-screen=menu] .court-caption { display:none; }
  /* The portrait lobby is an opaque sheet; hiding the 3D canvas removes any dark edge behind it. */
  body[data-screen=menu] #court { display:none; }
  body[data-screen=menu] .topbar { height: calc(var(--header-height) + var(--safe-top)); padding-top: var(--safe-top); }
  body[data-screen=menu] .menu-panel { top: calc(var(--header-height) + var(--safe-top)); }
  .menu-panel { padding:28px 24px max(18px,var(--safe-bottom)); }
  .menu-panel h1 { font-size:44px; margin:10px 0; }.intro { font-size:12px; margin-bottom:20px; }
  .role-card { padding:11px; }.role-note { margin-bottom:12px; }.launch-actions { padding-top:10px; }.launch-actions .primary-btn { min-height:48px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; animation:none!important; } }

/* The lobby can scroll independently while the court preview remains fixed. */
.menu-panel[data-entry="home"] {
  display:flex;
  overflow-y:auto;
  overscroll-behavior:contain;
  touch-action:pan-y;
}
.menu-panel[data-entry="home"] > * { flex-shrink:0; }
.menu-panel[data-entry="home"] .setup { flex:1 0 auto; justify-content:flex-start; }
.menu-panel[data-entry="home"] #home-actions {
  flex:1 0 auto;
  grid-template-columns:minmax(0,1fr);
  grid-auto-rows:1fr;
  gap:6px;
  padding:8px 0;
}
#home-actions button { min-height:clamp(64px,10vh,96px); padding:14px 18px; text-align:left; }
#home-actions .entry-copy { min-width:0; display:flex; flex-direction:column; gap:5px; font-size:inherit; letter-spacing:0; }
#home-actions .entry-copy strong { font-size:17px; }
#home-actions .entry-copy small { font-size:12px; font-weight:400; opacity:.78; }
@media (orientation:portrait) {
  .menu-panel[data-entry="home"] .intro { margin-bottom:12px; }
  .menu-panel[data-entry="home"] #home-actions { padding:8px 0; }
  #home-actions button { min-height:68px; padding:12px; }
}
@media (orientation:portrait) and (max-height:700px) {
  .menu-panel { padding:20px 20px max(14px,var(--safe-bottom)); }
  .menu-panel h1 { font-size:38px; margin:8px 0 10px; }
  .menu-heading .intro { margin-bottom:14px; }
  .menu-panel[data-entry="home"] #home-actions { gap:8px; padding:8px 0 2px; }
  .menu-panel[data-entry="home"] #home-actions button { padding:12px 16px; }
  .menu-panel[data-entry="home"] #home-actions .entry-copy { gap:4px; }
  .menu-panel[data-entry="home"] #home-actions .entry-copy strong { font-size:16px; }
  .menu-panel[data-entry="home"] #home-actions .entry-copy small { font-size:11px; }
  .menu-foot { margin-top:10px; }
}
@media (max-height:550px) and (orientation:landscape) {
  .menu-panel[data-entry="home"] .intro { display:block; margin:0; font-size:11px; }
  .menu-panel[data-entry="home"] #home-actions { gap:7px; padding:8px 0; }
  #home-actions button { min-height:56px; padding:8px 12px; }
  #home-actions .entry-copy { gap:3px; }
  #home-actions .entry-copy strong { font-size:14px; }
  #home-actions .entry-copy small { font-size:10px; }
}
@media (max-height:500px) and (orientation:landscape) {
  .menu-panel[data-entry="home"] #home-actions { gap:4px; padding:4px 0; }
  #home-actions button { min-height:44px; padding:5px 8px; gap:4px; white-space:normal; }
  .menu-panel[data-entry="home"] #home-actions .entry-copy small .tag { display:none; }
}
/* Keep home controls compact even if rotation updates the width before the height.
   Intrinsic row sizing still allows extra room for wrapped text. */
@media (max-height:550px) and (orientation:landscape),
       (pointer:coarse) and (550px <= width <= 960px) and (min-aspect-ratio:1/1) {
  .menu-panel[data-entry="home"] #home-actions {
    flex:0 0 auto;
    grid-auto-rows:minmax(clamp(44px,15svh,60px),auto);
    width:min(100%,360px);
    margin-inline:auto;
  }
  .menu-panel[data-entry="home"] #home-actions button { min-height:44px; padding:5px 8px; }
}
@media (max-height:360px) and (orientation:landscape) {
  .menu-panel[data-entry="home"] .intro { display:none; }
}

/* HELL-1: local challenge, keeping the established glass and court lighting. */
#home-actions .hell-entry { position:relative; overflow:hidden; isolation:isolate; border-color:#bd745d88; background:linear-gradient(115deg,#fff8eecc,#f0ded4aa); box-shadow:inset 0 1px 0 #ffffffda,0 4px 16px #7b493310; }
.hell-entry::before { content:""; position:absolute; inset:-100% -40%; z-index:-1; background:linear-gradient(110deg,transparent 40%,#fff9 50%,transparent 60%); transform:translateX(-30%); animation:hell-shimmer 6s ease-in-out infinite; pointer-events:none; }
.hell-entry:active { transform:scale(.985); }
.hell-entry em { font-size:9px; font-style:normal; font-weight:600; letter-spacing:1px; border:1px solid #9b4e3a66; border-radius:4px; padding:2px 5px; vertical-align:middle; }
#home-actions .hell-entry-mark { font-size:19px; letter-spacing:3px; opacity:.65; }
@media (max-width:600px) and (max-height:360px) and (orientation:landscape) {
  #home-actions .hell-entry-mark { display:none; }
}
.hell-contract { display:flex; align-items:center; justify-content:space-around; padding:6px 8px 8px; border-bottom:1px solid var(--line); }
.hell-contract>span { display:flex; flex-direction:column; gap:4px; font-size:11px; }
.hell-contract strong { font-size:32px; line-height:1.1; font-weight:650; }.hell-contract strong small { font-size:12px; font-weight:400; }
.hell-contract>b { opacity:.4; font-size:12px; letter-spacing:2px; }
.hell-skills { display:grid; gap:6px; margin:8px 0; }.hell-skills article { border:1px solid #9b68532c; border-radius:10px; padding:7px 10px; background:#ffffff44; }
.hell-skills b { font-size:12px; }.hell-skills p { font-size:11px; line-height:1.45; margin:3px 0 0; opacity:.76; }
.hell-setup .hell-confirm { position:sticky; bottom:0; margin-top:8px; }
.hell-status { max-width:340px; display:flex; flex-direction:column; gap:4px; padding:9px 12px; border:1px solid #b6d6c966; border-radius:12px; background:#143b3bdb; color:#fff3df; backdrop-filter:blur(16px); pointer-events:none; }
.hell-status b { font-size:12px; letter-spacing:.5px; }.hell-status span { font-size:10px; opacity:.85; line-height:1.4; }
.hell-status[data-skill="charge"],.hell-status[data-skill="cannon"] { border-color:#ffb288; }.hell-status[data-skill="recovery"] { border-color:#b5ebc7; }
@keyframes hell-shimmer { 0%,25% { transform:translateX(-30%); } 75%,100% { transform:translateX(30%); } }
@media(max-height:500px) and (orientation:landscape) { .hell-contract { padding:4px 8px 8px; }.hell-contract strong { font-size:28px; }.hell-skills { gap:5px; margin:7px 0; }.hell-skills article { padding:7px 10px; }.hell-status { padding:6px 9px; max-width:260px; }.hell-status span { font-size:9px; } }
@media(prefers-reduced-motion:reduce) { .hell-entry::before { animation:none; } }

/* Small flames stay inside the card's lower edge, clear of its label. */
.hell-entry::after { content:""; position:absolute; inset:auto 0 0; height:20px; z-index:-1; pointer-events:none; background:radial-gradient(ellipse at 50% 110%,#ff9c4259,transparent 72%); opacity:.7; animation:hell-heat 2.8s ease-in-out infinite alternate; }
.hell-fire { position:absolute; left:0; right:0; bottom:0; height:24px; z-index:-1; pointer-events:none; overflow:hidden; }
.hell-fire i { position:absolute; bottom:-6px; left:8%; width:12px; height:22px; border-radius:70% 15% 60% 45%; background:linear-gradient(35deg,#e15b2444,#ffad587d 55%,#fff3bf88); filter:blur(.65px); transform-origin:50% 100%; animation:hell-flame 1.8s ease-in-out infinite alternate; }
.hell-fire i:nth-child(2) { left:23%; height:15px; width:8px; animation-delay:-.6s; }
.hell-fire i:nth-child(3) { left:39%; height:20px; width:10px; animation-delay:-1.2s; }
.hell-fire i:nth-child(4) { left:54%; height:16px; width:9px; animation-delay:-.35s; }
.hell-fire i:nth-child(5) { left:69%; height:24px; width:12px; animation-delay:-1.4s; }
.hell-fire i:nth-child(6) { left:84%; height:17px; width:9px; animation-delay:-.9s; }
.hell-fire i:nth-child(7) { left:94%; height:13px; width:7px; animation-delay:-.2s; }
@keyframes hell-flame { from { transform:rotate(-12deg) scale(.8,.7); opacity:.35; } to { transform:rotate(10deg) scale(1,1.08); opacity:.75; } }
@keyframes hell-heat { from { opacity:.4; } to { opacity:.85; } }
@media(prefers-reduced-motion:reduce) { .hell-fire i,.hell-entry::after { animation:none; } .hell-fire i { opacity:.45; } }

@media (max-height:280px) and (orientation:landscape) {
  body[data-screen="menu"]:has(#menu[data-entry="home"]) { --menu-width:max(46%, 300px); }
}
