:root {
  --cream: #f7f1ee;
  --paper: #fffaf4;
  --ink: #352b3c;
  --muted: #7a6878;
  --pink: #a8365f;
  --pink-soft: #eab4ca;
  --purple: #6b4fa0;
  --green: #5c8b56;
  --shadow: 0 24px 60px rgba(71, 38, 68, .18), 0 6px 18px rgba(74, 43, 70, .12);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(255,255,255,.95) 0 3%, transparent 18%),
    radial-gradient(circle at 88% 88%, rgba(222,181,208,.32), transparent 28%),
    linear-gradient(135deg, #faf5ed, #f5ecef 52%, #eee8f7);
}
button { font: inherit; }
button:focus-visible { outline: 3px solid #4b7f4a; outline-offset: 3px; }

.game-shell {
  --shell-space: clamp(6px, 1vw, 14px);
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: 100svh;
  margin: 0 auto;
  padding: var(--shell-space);
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 54fr) minmax(0, 46fr);
  gap: var(--shell-space);
}

.device-column { display: grid; justify-items: center; gap: var(--space-md); min-width: 0; }
.device-wrap { position: relative; width: min(455px, 100%); padding-top: 32px; }
.device {
  position: relative;
  width: 100%;
  aspect-ratio: .86;
  border: 3px solid rgba(107,79,160,.34);
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background:
    radial-gradient(ellipse at 25% 18%, rgba(255,255,255,.98), transparent 25%),
    linear-gradient(145deg, #fffdf7 8%, #f5dce9 50%, #d9c9ed 100%);
  box-shadow: var(--shadow), inset 12px 12px 26px rgba(255,255,255,.9), inset -12px -16px 26px rgba(117,72,128,.13);
  padding: 15% 10.5% 8.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5%;
  isolation: isolate;
}
.device::before, .device::after {
  content: "✿";
  position: absolute;
  z-index: -1;
  color: rgba(168,54,95,.18);
  font-size: clamp(28px, 4vw, 48px);
}
.device::before { left: 3%; top: 34%; transform: rotate(-18deg); }
.device::after { right: 4%; bottom: 14%; transform: rotate(22deg); }
.shine { position: absolute; inset: 4% auto auto 13%; width: 20%; height: 33%; border-radius: 50%; border-left: 6px solid rgba(255,255,255,.66); transform: rotate(23deg); pointer-events: none; }

.metal-plate {
  position: absolute;
  top: 3.2%; left: 50%; transform: translateX(-50%);
  width: 35%; height: 10%;
  padding: 5px 14px;
  border: 2px solid #796e78;
  border-radius: 44% 44% 28% 28%;
  background: linear-gradient(160deg, #f7f4ef, #a9a4ae 48%, #f8f3ed 82%);
  box-shadow: inset 0 2px 2px white, 0 3px 8px rgba(48,34,46,.24);
}
.metal-plate svg { width: 100%; height: 100%; }
.metal-plate path { fill: none; stroke: #3b3240; stroke-width: 5; stroke-linecap: round; }

.cord { position: absolute; z-index: 4; left: -1%; top: 0; width: 90px; height: 132px; border: 10px solid #8b294d; border-right-color: transparent; border-bottom-color: transparent; border-radius: 60% 0 0 0; transform: rotate(-20deg); filter: drop-shadow(0 5px 3px rgba(75,30,49,.22)); }
.cord::before { content: ""; position: absolute; width: 11px; height: 90px; left: -8px; top: 48px; border-radius: 8px; background: repeating-linear-gradient(90deg, #7e2145 0 4px, #b44568 4px 8px); transform: rotate(9deg); }
.cord-knot { position: absolute; left: -17px; top: 114px; width: 28px; height: 22px; background: #8b294d; border-radius: 45%; }
.tassel { position: absolute; left: -30px; top: 129px; width: 50px; height: 64px; border-radius: 45% 45% 65% 65%; background: repeating-linear-gradient(90deg, #7b2044 0 5px, #b63f65 5px 9px); clip-path: polygon(18% 0,82% 0,100% 100%,0 100%); }
.flower-charm { position: absolute; z-index: 5; left: 2%; top: 10%; width: 58px; height: 58px; color: #ffe389; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, #ffe087 0 14%, transparent 15%), conic-gradient(from 0deg, #397b48 0 12%, transparent 12% 20%, #4b9555 20% 32%, transparent 32% 40%, #337342 40% 52%, transparent 52% 60%, #559d5e 60% 72%, transparent 72% 80%, #397b48 80% 92%, transparent 92%); filter: drop-shadow(0 4px 4px rgba(32,64,38,.28)); transform: rotate(-14deg); }

.screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 12% 12% 9% 9%; background: #291b2c; isolation: isolate; }
.scene-art, .scene-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-art { background: #291b2c; }
.scene-art img { display: none; object-fit: cover; z-index: 2; }
.scene-art img.is-ready { display: block; }
#scenePrevious { z-index: 1; }
.scene-depth { position: absolute; inset: auto 0 0; z-index: 1; transition: opacity .32s ease-out; }
.scene-depth.far { height: 47%; background: linear-gradient(135deg, #6c855c 25%, #a5b46e 25% 50%, #73865b 50% 75%, #a1ac68 75%); clip-path: polygon(0 75%,12% 40%,25% 66%,42% 20%,56% 63%,73% 34%,88% 68%,100% 30%,100% 100%,0 100%); opacity: .7; }
.scene-depth.near { height: 31%; background: repeating-linear-gradient(90deg, #925d42 0 18%, #70452f 18% 21%, #b37b4d 21% 38%); clip-path: polygon(0 25%,8% 18%,9% 0,12% 0,13% 17%,24% 24%,32% 18%,34% 0,37% 0,39% 18%,54% 24%,64% 18%,66% 0,69% 0,71% 18%,87% 24%,100% 18%,100% 100%,0 100%); }

.screen[data-scene="ramen"] .scene-art { background: linear-gradient(#dd8b55, #7b3040 55%, #4b252d); }
.screen[data-scene="ramen"] .far { background: repeating-linear-gradient(90deg, #8d2b35 0 15%, #f0c270 15% 17%, #6d242f 17% 32%); clip-path: polygon(0 20%,100% 20%,100% 100%,0 100%); }
.screen[data-scene="ramen"] .near { background: linear-gradient(#7e4a2d 0 14%, #3f2724 15% 100%); clip-path: polygon(0 62%,100% 62%,100% 100%,0 100%); }
.screen[data-scene="zimmer"] .scene-art { background: linear-gradient(135deg, #e7d1bb, #b88ea2 58%, #6f5979); }
.screen[data-scene="zimmer"] .far { background: linear-gradient(90deg, #7e594b 0 8%, #e6d0b7 8% 44%, #765443 44% 50%, #c7d7c0 50% 78%, #765443 78% 84%, #e9d6c2 84%); clip-path: inset(8% 0 0); }
.screen[data-scene="zimmer"] .near { background: linear-gradient(12deg, #6c594e 0 38%, #e4c1ce 39% 67%, transparent 68%); clip-path: polygon(0 72%,42% 60%,74% 75%,100% 64%,100% 100%,0 100%); }
.screen[data-scene="training"] .scene-art { background: linear-gradient(#b9dceb 0 52%, #cfad69 53%); }
.screen[data-scene="training"] .far { background: repeating-linear-gradient(90deg, #6b4937 0 4%, transparent 4% 16%); clip-path: polygon(0 42%,100% 42%,100% 48%,0 48%); }
.screen[data-scene="training"] .near { width: 20%; height: 55%; left: 67%; background: linear-gradient(90deg, #6e3825, #b46b3d, #63301f); clip-path: polygon(34% 0,66% 0,67% 38%,100% 42%,100% 52%,67% 50%,67% 100%,34% 100%,33% 55%,0 59%,0 49%,33% 45%); }
.screen[data-scene="natur"] .scene-art { background: linear-gradient(#81c6da 0 42%, #91bd6f 43%); }
.screen[data-scene="natur"] .far { background: radial-gradient(circle at 72% 30%, #f5bdd2 0 18%, transparent 19%), radial-gradient(circle at 18% 32%, #4b8a52 0 25%, transparent 26%); clip-path: none; height: 70%; }
.screen[data-scene="natur"] .near { background: linear-gradient(120deg, transparent 0 30%, #6fc4cb 31% 47%, transparent 48%), linear-gradient(#589348,#3e743b); clip-path: polygon(0 35%,100% 13%,100% 100%,0 100%); }
.screen[data-scene="akademie"] .scene-art { background: linear-gradient(#b8d9e6 0 48%, #d5ad70 49%); }
.screen[data-scene="akademie"] .far { background: linear-gradient(90deg, #e4ddc2 0 10%, #8e3c35 10% 18%, #eadfc5 18% 82%, #8e3c35 82% 90%, #ded3b6 90%); clip-path: polygon(0 27%,44% 27%,50% 0,56% 27%,100% 27%,100% 100%,0 100%); }
.screen[data-scene="mission"] .scene-art { background: linear-gradient(#678392 0 47%, #334b46 48%); }
.screen[data-scene="mission"] .far { background: linear-gradient(135deg,#273e45,#526a5d); opacity: .9; }
.screen[data-scene="mission"] .near { background: repeating-linear-gradient(75deg,#203c36 0 10%,#355948 10% 20%); clip-path: polygon(0 12%,20% 44%,32% 20%,50% 52%,68% 8%,85% 40%,100% 18%,100% 100%,0 100%); }

.screen-topline { position: absolute; z-index: 9; inset: 10px 12px auto; display: flex; justify-content: space-between; gap: 8px; color: #fffaf2; font-size: .72rem; font-weight: 700; text-shadow: 0 2px 3px #33283d; }
.screen-topline span { white-space: nowrap; background: rgba(48,37,55,.55); padding: 4px 8px; border-radius: 999px; backdrop-filter: blur(4px); }
.screen-message { position: absolute; z-index: 9; left: 50%; bottom: 8px; transform: translateX(-50%); max-width: 90%; width: max-content; padding: 5px 10px; border-radius: 10px; color: #fffaf4; background: rgba(52,39,58,.78); font-size: .7rem; text-align: center; box-shadow: 0 3px 8px rgba(38,29,42,.18); }

.actor { --facing: 1; position: absolute; z-index: 5; left: 0; bottom: 8%; width: 0; height: var(--actor-height, 0px); }
.actor.is-walking { will-change: transform; }
.actor::after { content: ""; position: absolute; z-index: -1; left: 0; bottom: -3%; width: calc(var(--actor-height) * .38); height: 7%; transform: translateX(-50%); border-radius: 50%; background: rgba(40,31,37,.28); filter: blur(2px); transition: transform .12s ease-out, opacity .12s ease-out; }
.actor.is-airborne::after { transform: translateX(-50%) scale(.68); opacity: .55; }
.actor.is-sleeping::after { width: calc(var(--actor-height) * .65); height: 5%; bottom: -1%; background: #2b1d2e54; }
.sprite-sheet, .sprite-ghost, .sprite, .chibi {
  position: absolute; left: calc(-1 * var(--foot-x, var(--actor-height) / 2)); bottom: calc(-1 * var(--foot-inset, 0px));
  width: var(--cell-width, var(--actor-height)); height: 100%;
  transform: scaleX(var(--facing)); transform-origin: var(--foot-x, 50%) calc(100% - var(--foot-inset, 0px));
  filter: drop-shadow(0 5px 3px rgba(39,31,45,.22));
}
.sprite-sheet, .sprite-ghost { height: var(--cell-height, 100%); overflow: hidden; }
.sprite-sheet::before, .sprite-ghost::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--strip-width);
  background: var(--sheet) 0 0 / 100% 100% no-repeat;
  transform: translateX(var(--frame-offset, 0px));
}
.sprite-sheet { display: none; }
.sprite-ghost { z-index: 2; pointer-events: none; opacity: 0; }
.actor.has-sheet .sprite-sheet { display: block; }
.actor.has-sheet .sprite, .actor.has-sheet .chibi { display: none; }
.sprite { display: none; object-fit: contain; object-position: center bottom; }
.sprite.is-ready { display: block; }
.sprite.is-ready + .chibi { display: none; }
.actor:is(.is-idle, .is-sad, .is-sick, .is-angry, .is-exhausted, .is-sleeping) > :is(.sprite-sheet, .sprite, .chibi) {
  animation: idleBreath 3.6s ease-in-out infinite;
}
.actor.is-sleeping { --sway: 0deg; }
.actor:is(.is-eating, .is-drinking, .is-playing, .is-caring) > :is(.sprite-sheet, .sprite, .chibi) {
  animation: poseMotion var(--pose-duration) ease-in-out infinite;
}
.actor.is-eating { --pose-duration: .5s; --pose-y: .977; --pose-tilt: 1deg; }
.actor.is-drinking { --pose-duration: .375s; --pose-y: 1.012; --pose-tilt: -1deg; }
.actor.is-playing { --pose-duration: .4s; --pose-y: .963; --pose-tilt: 1.5deg; }
.actor.is-caring { --pose-duration: .375s; --pose-y: 1.018; --pose-tilt: -.8deg; }

.head { position: absolute; width: 62%; aspect-ratio: 1.05; left: 19%; top: 10%; border-radius: 50% 50% 45% 45%; background: #f8d9c9; border: 2px solid #4e4050; z-index: 4; }
.hair-back { position: absolute; width: 75%; height: 55%; left: 12%; top: 4%; border-radius: 50% 50% 40% 40%; background: linear-gradient(135deg,#fff,#d9d1e4); border: 2px solid #4e4050; z-index: 2; }
.fringe { position: absolute; width: 66%; height: 31%; left: 17%; top: 4%; z-index: 6; border-radius: 52% 52% 34% 34%; background: linear-gradient(145deg,#fff,#ded7e9); clip-path: polygon(0 0,100% 0,92% 61%,77% 40%,67% 92%,52% 45%,40% 89%,25% 41%,8% 73%); }
.eye { position: absolute; z-index: 7; top: 33%; width: 8%; height: 12%; border-radius: 50%; background: radial-gradient(circle at 65% 30%, #fff 0 16%, #69a04f 17% 46%, #1d4328 47%); }
.eye-left { left: 34%; } .eye-right { right: 34%; }
.mouth { position: absolute; z-index: 7; left: 46%; top: 49%; width: 9%; height: 5%; border-bottom: 2px solid #a94e5c; border-radius: 50%; }
.hair-braid { position: absolute; z-index: 3; top: 40%; width: 13%; height: 40%; background: repeating-linear-gradient(#f6f2f8 0 13%,#c9bed7 14% 24%); border: 2px solid #4e4050; border-radius: 45%; }
.braid-left { left: 12%; transform: rotate(8deg); } .braid-right { right: 12%; transform: rotate(-8deg); }
.flower { position: absolute; z-index: 9; top: 8%; right: 11%; color: #3f824a; font-size: clamp(18px,3vw,30px); text-shadow: 0 1px #183e26; }
.body { position: absolute; z-index: 3; left: 31%; top: 58%; width: 38%; height: 31%; border-radius: 38% 38% 20% 20%; background: linear-gradient(90deg,#25322d 0 22%,#7f9a5d 23% 76%,#25322d 77%); border: 2px solid #433844; }
.body::after { content: ""; position: absolute; left: 0; right: 0; top: 48%; height: 14%; background: #bd9e58; }
.arm, .leg { position: absolute; z-index: 2; background: #2d3331; border: 2px solid #433844; border-radius: 999px; transform-origin: top; }
.arm { top: 61%; width: 10%; height: 27%; } .arm-left { left: 25%; transform: rotate(12deg); } .arm-right { right: 25%; transform: rotate(-12deg); }
.leg { top: 82%; width: 11%; height: 17%; } .leg-left { left: 37%; } .leg-right { right: 37%; }

.actor.is-sad .mouth { border-bottom: 0; border-top: 2px solid #844454; }
.actor.is-sick { filter: saturate(.55) hue-rotate(24deg); }
.actor.is-exhausted { filter: saturate(.72); }
.actor.is-hitstop .sprite-sheet { filter: brightness(1.18) drop-shadow(0 0 7px rgba(255,229,129,.9)); }

#trainingPost { display: none; }
.impact-fx {
  position: absolute;
  z-index: 11;
  width: 25%;
  aspect-ratio: 1.4;
  translate: -50% 50%;
  opacity: 0;
  pointer-events: none;
  --impact-color: #ffe4a0;
  --impact-glow: #e48a47;
}
.impact-fx::before, .impact-fx::after { content: ""; position: absolute; inset: 0; }
.impact-fx::before {
  background:
    radial-gradient(ellipse at center, #fff9dc 0 5%, var(--impact-color) 7%, transparent 14%),
    radial-gradient(ellipse at 68% 32%, var(--impact-color) 0 2%, transparent 4%),
    radial-gradient(ellipse at 77% 62%, var(--impact-color) 0 1.6%, transparent 4%),
    radial-gradient(ellipse at 30% 73%, var(--impact-color) 0 1.5%, transparent 4%),
    radial-gradient(ellipse at 50% 50%, var(--impact-glow), transparent 49%);
}
.impact-fx::after {
  inset: 13% 17%;
  border: solid transparent;
  border-width: 2px 6px 3px 0;
  border-right-color: var(--impact-color);
  border-bottom-color: var(--impact-color);
  border-radius: 50%;
  transform: scaleX(var(--impact-facing, 1)) rotate(-19deg);
  filter: drop-shadow(0 0 3px var(--impact-glow));
}
.impact-fx[data-impact="kick"] { --impact-color: #d3ffd6; --impact-glow: #63bb8b; }
.impact-fx[data-impact="kick"]::after { inset: 2% 12%; transform: scaleX(var(--impact-facing, 1)) rotate(-46deg); }
.impact-fx[data-impact="finisher"] { width: 33%; --impact-color: #ffeda9; --impact-glow: #f9ae56; }
.impact-fx[data-impact="finisher"]::before {
  background:
    radial-gradient(ellipse at 50% 50%, #fff8df 0 4%, #ffc96c 9%, transparent 32%),
    radial-gradient(ellipse 4% 2% at 88% 40%, #fff7ce 0 60%, transparent 100%),
    radial-gradient(ellipse 3% 2% at 76% 18%, #fff7ce 0 60%, transparent 100%),
    radial-gradient(ellipse 3% 2% at 19% 73%, #fff7ce 0 60%, transparent 100%),
    radial-gradient(ellipse 3% 2% at 37% 89%, #fff7ce 0 60%, transparent 100%);
}
.impact-fx[data-impact="finisher"]::after {
  inset: 3% 15%;
  border: 3px solid var(--impact-color);
  border-right-color: #fff9dd;
  box-shadow: inset 0 0 6px var(--impact-glow), 0 0 7px #c46b2a;
}
.ambient-fx { position: absolute; z-index: 9; inset: 0; overflow: hidden; pointer-events: none; }
.dust, .steam-puff, .zzz, .play-heart, .sweat-drop { position: absolute; pointer-events: none; }
.dust { width: 11px; height: 7px; border-radius: 50%; background: rgba(239,220,183,.72); filter: blur(1px); animation: dustPuff .42s ease-out forwards; }
.steam-puff { width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.72); border-radius: 50%; animation: steamRise 1.1s ease-out forwards; }
.zzz { color: #e8e1ff; font-family: "Kaisei Decol", serif; font-weight: 700; text-shadow: 0 2px 5px rgba(36,30,74,.55); animation: zzzRise 1.8s ease-out forwards; }

.play-heart { color: #ff9ac4; font-size: .95rem; text-shadow: 0 1px 4px #853857; animation: heartRise .9s ease-out forwards; }
.mood-emoji { position: absolute; font-size: 1.05rem; pointer-events: none; animation: moodEmojiRise 1.65s ease-out both; }
@keyframes moodEmojiRise {
  0% { opacity: 0; transform: translate(-50%, 5px); }
  18% { opacity: .9; }
  100% { opacity: 0; transform: translate(-50%, -28px); }
}
.sweat-drop { width: 5px; height: 8px; border-radius: 55% 55% 65% 65%; background: #b9e9fa; box-shadow: 0 1px 3px #644f70; animation: sweatArc .44s ease-out forwards; }

.speech { position: absolute; z-index: 10; left: 61%; top: 23%; min-width: 43px; height: 43px; padding: 7px; display: grid; place-items: center; border-radius: 50% 50% 50% 16%; background: #fffaf2; border: 2px solid #4a3a4b; box-shadow: 0 4px 8px rgba(46,31,48,.18); animation: bubbleIn .35s cubic-bezier(.2,.9,.3,1.4); }
.speech img { display: none; width: 27px; height: 27px; object-fit: contain; }
.speech img.is-ready { display: block; }
.speech img.is-ready + span { display: none; }
.speech span { font-size: 1.35rem; }
.floaters { position: absolute; z-index: 12; inset: 0; pointer-events: none; }
.floater { position: absolute; left: 54%; top: 48%; padding: 4px 8px; border-radius: 999px; color: white; background: var(--pink); font-weight: 700; font-size: .75rem; box-shadow: 0 4px 8px rgba(42,30,44,.2); animation: floatUp 1.8s ease-out forwards; }
.event-prompt { position: absolute; z-index: 14; right: 5%; top: 16%; width: 32px; height: 32px; border: 2px solid #fff7eb; border-radius: 50%; color: white; background: #b42e50; font-size: 1rem; font-weight: 700; box-shadow: 0 5px 0 #76203b, 0 8px 12px rgba(44,26,40,.2); animation: eventPulse 1.3s ease-in-out infinite; cursor: pointer; }
.event-prompt::after { content: "Mission"; position: absolute; top: 110%; left: 50%; transform: translateX(-50%); font-size: .58rem; font-weight: 700; color: #fff; background: rgba(52,39,58,.8); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.level-up { position: absolute; z-index: 18; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: #613e84; text-align: center; background: radial-gradient(circle, rgba(255,251,211,.96), rgba(238,200,244,.86) 58%, rgba(255,255,255,.2) 70%); animation: levelFlash 3.5s ease both; }
.level-up[hidden], .event-prompt[hidden], .speech[hidden] { display: none; }
.level-up strong { width: 80%; font-family: "Kaisei Decol", serif; font-size: 1.15rem; }
.level-stars { font-size: 2.1rem; color: #d28d27; letter-spacing: 8px; animation: starSpin 1s linear infinite; }

.weather { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.weather::before, .weather::after { content: ""; position: absolute; inset: -30%; }
.weather-sun::before { inset: 8% auto auto 9%; width: 42px; height: 42px; border-radius: 50%; background: #ffe587; box-shadow: 0 0 24px 9px rgba(255,222,105,.58); }
.weather-rain::before { background: repeating-linear-gradient(105deg, transparent 0 18px, rgba(205,235,255,.68) 19px 21px, transparent 22px 37px); animation: rain .65s linear infinite; }
.weather-snow::before { background-image: radial-gradient(circle at 20% 30%,rgba(255,255,255,.85) 0 1.6px,transparent 2.4px),radial-gradient(circle at 70% 60%,rgba(255,255,255,.7) 0 1.2px,transparent 2px),radial-gradient(circle at 45% 85%,rgba(255,255,255,.6) 0 1px,transparent 1.8px); background-size: 97px 113px, 71px 83px, 131px 149px; opacity: .8; animation: snow 9s linear infinite; }
.weather-snow::after { background-image: radial-gradient(circle at 60% 20%,rgba(255,255,255,.75) 0 2px,transparent 3px); background-size: 157px 173px; opacity: .7; animation: snow 14s linear infinite reverse; animation-direction: normal; }

.device-controls { width: 72%; height: 13%; display: flex; justify-content: space-between; align-items: center; }
.device-button { width: clamp(48px, 6vw, 66px); aspect-ratio: 1; border-radius: 50%; border: 3px solid #64485e; color: #5d4059; background: linear-gradient(145deg,#fff4df,#e8b5c8); box-shadow: inset 3px 3px 4px rgba(255,255,255,.9), inset -4px -5px 7px rgba(114,70,101,.22), 0 6px 0 #7b5570, 0 9px 14px rgba(59,37,57,.2); font-weight: 700; font-size: 1.2rem; cursor: pointer; transition: transform .13s, box-shadow .13s; }
.device-button.confirm { width: clamp(58px, 7vw, 78px); color: var(--pink); }
.device-button:active, .device-button.is-clicked { transform: translateY(5px) scale(.96); box-shadow: inset 2px 3px 6px rgba(105,64,94,.28), 0 1px 0 #7b5570; }
.twitch-hint { margin: 0; color: var(--muted); font-size: clamp(.66rem, 1.2vw, .78rem); text-align: center; }
.twitch-hint b { color: var(--pink); }

.status-card { position: relative; width: 100%; max-width: 470px; padding: clamp(16px, 2vw, 22px); border: 1px solid rgba(107,79,160,.18); border-radius: 28px; background: rgba(255,250,244,.9); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.status-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg,var(--pink),#d184a5,var(--purple)); }
.exit-button { position: absolute; right: 14px; top: 13px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: rgba(107,79,160,.08); font-size: 1.3rem; cursor: pointer; }
.profile { display: flex; align-items: center; gap: var(--space-lg); padding-right: 35px; }
.rank-portrait { width: 74px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; border: 3px solid #fffaf4; border-radius: 50%; background: linear-gradient(145deg,#dceccf,#ead3e8); box-shadow: 0 0 0 2px rgba(107,79,160,.24), 0 7px 16px rgba(70,43,70,.14); overflow: hidden; }
.rank-portrait img { display: none; width: 100%; height: 100%; object-fit: contain; }
.rank-portrait img.is-ready { display: block; }
.rank-portrait img.is-ready + span { display: none; }
.rank-portrait span { font-family: "Kaisei Decol", serif; font-size: 1.75rem; color: var(--purple); }
.profile h1 { margin: 0; font-family: "Kaisei Decol", serif; font-size: clamp(1.6rem,3vw,2.15rem); color: #4b3654; line-height: 1.05; }
.profile h1 span { color: var(--pink); }
.profile p { margin: 3px 0 0; color: var(--muted); }
.profile .eyebrow { color: var(--pink); font-size: .68rem; font-weight: 700; letter-spacing: .14em; }

.needs { display: grid; gap: 8px; margin-top: 18px; }
.need-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; font-size: .78rem; font-weight: 700; }
.need-label output { min-width: 26px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.need-icon { width: 20px; height: 20px; margin-right: 5px; object-fit: contain; vertical-align: -5px; }
.bar { height: 11px; border-radius: 99px; background: #e8e0e5; overflow: hidden; box-shadow: inset 0 1px 3px rgba(54,38,53,.18); }
.bar span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .8s cubic-bezier(.2,.8,.2,1), filter .25s; box-shadow: inset 0 2px rgba(255,255,255,.35); }
.need[data-key="hunger"] .bar span { background: linear-gradient(90deg,#d87831,#f3a644); }
.need[data-key="thirst"] .bar span { background: linear-gradient(90deg,#398ccb,#66bee8); }
.need[data-key="energy"] .bar span { background: linear-gradient(90deg,#4f8a4b,#8bc769); }
.need[data-key="mood"] .bar span { background: linear-gradient(90deg,#c4507e,#ed88ac); }
.need[data-key="exp"] .bar span { background: linear-gradient(90deg,#624795,#9c77c9); }
.need.is-critical .bar { animation: criticalPulse 1s ease-in-out infinite; }
.need.is-changing .bar span { filter: brightness(1.25) saturate(1.2); }

.evolution { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.evolution li { position: relative; min-width: 0; display: grid; justify-items: center; gap: 1px; color: var(--muted); font-size: .54rem; font-weight: 700; }
.evolution li:not(:last-child)::after { content: "›"; position: absolute; top: 19px; right: -7px; color: rgba(107,79,160,.45); font-size: 1rem; }
.evolution img { width: 42px; height: 42px; object-fit: contain; filter: brightness(0); opacity: .12; transition: filter .25s, opacity .25s; }
.evolution li.is-reached img { filter: none; opacity: 1; }
.evolution li.is-current img { border-radius: 50%; outline: 2px solid #d9467b; outline-offset: 2px; }
.evolution li.is-current span { color: var(--pink); }
.selected-action { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; padding: 7px 12px; border-radius: 12px; color: var(--muted); background: rgba(107,79,160,.07); font-size: .72rem; }
.selected-action strong { color: var(--purple); font-family: "Kaisei Decol", serif; font-size: .86rem; }
.actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 10px; }
.action { position: relative; min-width: 0; min-height: 68px; padding: 7px 5px 6px; display: grid; justify-items: center; align-content: center; gap: 2px; border: 1px solid rgba(107,79,160,.16); border-radius: 16px; color: var(--ink); background: #fffdf8; box-shadow: 0 4px 10px rgba(66,42,63,.07); cursor: pointer; transition: transform .15s, border-color .2s, background .2s, box-shadow .2s; }
.action:hover { transform: translateY(-2px); border-color: rgba(168,54,95,.45); box-shadow: 0 7px 15px rgba(84,48,76,.12); }
.action:active, .action.is-clicked { transform: scale(.93); }
.action.is-selected { color: #70314f; border-color: var(--pink); background: #fff1f5; box-shadow: 0 0 0 2px rgba(168,54,95,.11); }
.action.is-cooling { opacity: .7; }
.action-icon { width: 28px; height: 28px; object-fit: contain; }
.action > span:nth-child(2) { font-size: .72rem; font-weight: 700; }
.action small { min-height: 12px; color: var(--pink); font-size: .59rem; font-variant-numeric: tabular-nums; }
.status-note { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: .72rem; text-align: center; }

@keyframes idleBreath {
  0%, 100% { transform: scaleX(var(--facing)); }
  50% { transform: scale(var(--facing), 1.015) rotate(var(--sway, .5deg)); }
}
@keyframes poseMotion {
  0%, 100% { transform: scaleX(var(--facing)); }
  50% { transform: scale(calc(var(--facing) * (2 - var(--pose-y))), var(--pose-y)) rotate(var(--pose-tilt)); }
}
@keyframes heartRise {
  from { opacity: 0; transform: translate(-50%, 3px) scale(.65); }
  22% { opacity: 1; transform: translate(-50%, -4px) scale(1); }
  to { opacity: 0; transform: translate(-80%, -26px) scale(.85); }
}
@keyframes sweatArc {
  from { opacity: .9; transform: translate(0, 0) rotate(16deg) scale(.65); }
  30% { transform: translate(-5px, -5px) rotate(26deg) scale(1); }
  to { opacity: 0; transform: translate(-13px, 12px) rotate(35deg) scale(.75); }
}
.is-animation-paused *, .is-animation-paused *::before, .is-animation-paused *::after { animation-play-state: paused !important; }

@keyframes postWobble { 35%{transform:translateX(2px) rotate(.8deg)} 70%{transform:translateX(-1px) rotate(-.4deg)} }
@keyframes dustPuff { from{opacity:.9;transform:translate(-50%,0) scale(.45)} to{opacity:0;transform:translate(-50%,-10px) scale(1.45)} }
@keyframes steamRise { from{opacity:.8;transform:translate(-50%,0) scale(.55)} to{opacity:0;transform:translate(-50%,-34px) scale(1.5)} }
@keyframes zzzRise { from{opacity:0;transform:translate(0,8px) scale(.7)} 22%{opacity:1} to{opacity:0;transform:translate(18px,-54px) scale(1.15)} }
@keyframes bubbleIn { from{transform:scale(.1);opacity:0} }
@keyframes floatUp { to{transform:translateY(-95px);opacity:0} }
@keyframes eventPulse { 50%{transform:translateY(-5px) scale(1.08)} }
@keyframes levelFlash { 0%{opacity:0;transform:scale(.7)} 14%,80%{opacity:1;transform:scale(1)} 100%{opacity:0} }
@keyframes starSpin { to{transform:rotate(360deg)} }
@keyframes rain { to{transform:translate(18%,30%)} }
@keyframes snow { from{transform:translate(0,-20%)} to{transform:translate(5%,20%)} }
@keyframes criticalPulse { 50%{box-shadow:0 0 0 3px rgba(184,45,72,.18)} }

@media (prefers-reduced-motion: reduce) {
  .impact-fx::before { display: none; }
  .impact-fx::after { box-shadow: none; filter: none; }
  .dust { animation-duration: .22s; }
  .steam-puff { animation-duration: .6s; }
  .zzz, .play-heart { animation-duration: .65s; }
  .weather-rain::before { opacity: .4; animation-duration: 1.3s; }
  .weather-snow::before, .weather-snow::after { opacity: .3; }
  .level-up { animation-name: levelFade; }
  .level-stars { animation: none; }

  @keyframes levelFade { 0%,100%{opacity:0} 14%,86%{opacity:1} }
}

/* Kompaktes Handheld im bestehenden dunklen Farbschema. */
:root {
  color-scheme: dark;
  --paper: oklch(16.5% .02 335);
  --paper-2: oklch(20.5% .026 333);
  --paper-3: oklch(26% .032 330);
  --line: oklch(31% .032 330);
  --ink: oklch(95% .012 340);
  --ink-2: oklch(82% .022 335);
  --ink-3: oklch(66% .026 330);
  --rose: oklch(66% .16 355);
  --lilac: oklch(72% .12 300);
  --sage: oklch(78% .07 150);
  --rosegold: oklch(80% .07 48);
  --pink: var(--rose);
  --purple: var(--lilac);
  --muted: var(--ink-3);
  background: var(--paper);
  color: var(--ink);
}
body { min-width: 0; background: var(--paper); }
button:focus-visible { outline: 2px solid var(--rosegold); outline-offset: 2px; }
.play-area {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-inline-size: 0;
  min-block-size: 0;
  container-type: size;
}
.screen-frame {
  position: relative; width: min(100cqw, calc(100cqh * 1800 / 1542)); max-width: 100%; min-width: 0;
  height: auto; aspect-ratio: 1800 / 1542;
  justify-self: center; padding: 0; overflow: visible;
  border: 0; border-radius: 12px; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line);
}
.screen-frame::before {
  content: ""; position: absolute; inset: -2px; z-index: 20; pointer-events: none;
  border: 2px solid var(--rosegold); border-radius: 14px;
  box-shadow: 0 0 0 1px oklch(66% .16 355 / .28), 0 0 22px oklch(66% .16 355 / .34);
  opacity: 0; transform: scale(.995); transition: opacity 250ms ease-out, transform 250ms ease-out;
}
.screen-frame:hover::before, .play-area:focus-within .screen-frame::before, .screen-frame.is-touched::before { opacity: 1; transform: scale(1); }
.screen { height: auto; aspect-ratio: 16 / 9; border-radius: 12px; }
.screen-topline { inset: 12px 14px auto; font-size: clamp(.65rem, 1vw, .78rem); }
.screen-topline span { border-radius: 7px; background: oklch(16.5% .02 335 / .72); }
.screen-message { bottom: 5px; padding: 2px 7px; border-radius: 8px; color: var(--ink); background: oklch(16.5% .02 335 / .84); }
.device-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.screen-controls { display: flex; gap: 5px; }
.device-button, .device-button.confirm {
  width: 38px; height: 34px; padding: 0; border: 1px solid oklch(80% .07 48 / .55); border-radius: 8px;
  color: var(--ink); background: oklch(16.5% .02 335 / .83); box-shadow: 0 2px 8px oklch(12% .02 335 / .3);
  font-size: .7rem; line-height: 1; transition: transform .15s ease-out, background .15s ease-out;
}
.device-button.confirm { color: var(--rose); }
.device-button:active, .device-button.is-clicked { transform: scale(.9); box-shadow: 0 2px 8px oklch(12% .02 335 / .3); }
.speech { left: auto; right: 5%; top: 36%; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; }
.speech.is-angry { background: oklch(31% .1 25); border-color: oklch(65% .2 25); color: oklch(95% .04 25); box-shadow: 0 0 15px oklch(65% .2 25 / .35); }
.speech.is-angry img { display: none; }
.speech.is-angry span { display: block; }
.floater { border-radius: 7px; color: var(--ink); background: var(--paper-2); border: 1px solid var(--rosegold); }
.floater.is-coin { color: var(--rosegold); }
.event-prompt { background: var(--rose); border-color: var(--paper-2); box-shadow: 0 4px 12px oklch(12% .02 335 / .3); }
.level-up { color: var(--ink); background: radial-gradient(circle, oklch(26% .05 335 / .97), oklch(16.5% .02 335 / .86) 70%); }
.status-card {
  display: flex; flex-direction: column; align-self: center; gap: 8px;
  overflow-wrap: anywhere;
  max-width: none; min-width: 0; padding: clamp(10px, 1.3vw, 18px); line-height: 1.25;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2);
  box-shadow: none; backdrop-filter: none;
}
.status-card::before { height: 2px; background: linear-gradient(90deg,var(--rose),var(--rosegold),var(--lilac)); }
.exit-button { color: var(--ink-2); background: var(--paper-3); border-radius: 7px; }
.profile { gap: 9px; padding-right: 40px; }
.rank-portrait { width: clamp(42px, 5vw, 58px); border: 1px solid var(--line); border-radius: 9px; background: var(--paper-3); box-shadow: none; }
.rank-portrait span { color: var(--lilac); }
.profile h1 { color: var(--ink); font-size: clamp(1.15rem, 1.8vw, 1.55rem); }
.profile p { color: var(--ink-2); font-size: .82rem; }
.profile .eyebrow { color: var(--rose); font-size: .6rem; }
.needs { gap: clamp(6px, 1.4vh, 12px); margin: 0; }
.need-label { margin-bottom: 2px; color: var(--ink-2); font-size: .8rem; }
.need-label > span { display: flex; align-items: center; gap: 5px; }
.need-label output { color: var(--ink); }
.need-icon { width: 17px; height: 17px; margin: 0; }
.bar { height: 7px; background: var(--paper-3); box-shadow: none; }
.bar span { box-shadow: none; filter: saturate(.8); }
.evolution { gap: 3px; margin: 0; }
.evolution li { color: var(--ink-3); font-size: .64rem; }
.evolution li:not(:last-child)::after { color: var(--ink-3); }
.evolution img { width: 38px; height: 38px; opacity: .18; }
.evolution li.is-current img { outline-color: var(--rose); }
.selected-action { gap: 8px; margin: 0; padding: 4px 8px; border-radius: 7px; background: var(--paper-3); color: var(--ink-2); }
.selected-action strong { color: var(--lilac); }
.actions { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin: 0; }
.action { min-height: 56px; padding: 3px 1px; line-height: 1.15; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: var(--paper-3); box-shadow: none; }
.action:hover { border-color: var(--rose); background: oklch(30% .04 335); box-shadow: none; }
.action.is-selected { color: var(--ink); border-color: var(--rose); background: oklch(29% .055 350); box-shadow: none; }
.action-icon { width: 20px; height: 20px; }
.action > span:nth-child(2) { font-size: .68rem; }
.action small { min-height: 1em; color: var(--rosegold); font-size: .61rem; white-space: nowrap; }
.status-footer { padding-inline-end: 110px; }
.status-note, .coin-note { min-height: 0; margin: 0; color: var(--ink-2); font-size: .8rem; text-align: left; }
.coin-note { margin-top: 4px; color: var(--rosegold); font-size: .72rem; }

@media (width < 760px) {
  .device-button, .device-button.confirm, .exit-button { width: 44px; height: 44px; }
}
@media (max-width: 460px) {
  .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (hover: none) {
  .screen-frame:hover::before { opacity: 0; transform: scale(.995); }
  .screen-frame.is-touched::before, .play-area:focus-within .screen-frame::before { opacity: 1; transform: scale(1); }
}

/* Reaktionen bleiben am Fußpunkt der vorhandenen Sprites verankert. */
.actor:is(.is-angry, .is-sick, .is-too-full, .is-bored, .is-special) > :is(.sprite-sheet, .sprite, .chibi) {
  animation: var(--reaction-motion) both;
}
.actor.is-angry { --reaction-motion: irritated 1.4s ease-in-out infinite; }
.actor.is-sick { --reaction-motion: weakSway 2.1s ease-in-out infinite; }
.actor.is-too-full { --reaction-motion: tooFull 1.1s ease-in-out 3; }
.actor.is-bored { --reaction-motion: yawn 2.2s ease-in-out; }
.actor.is-special { --reaction-motion: happyHop .8s ease-out 2; }
@keyframes irritated {
  0%, 100% { transform: scaleX(var(--facing)); }
  24% { transform: translateY(-2%) scale(var(--facing), 1.015); }
  39% { transform: scale(calc(var(--facing) * 1.04), .94); }
  60% { transform: scaleX(var(--facing)); }
}
@keyframes weakSway {
  0%, 100% { transform: scale(var(--facing), .96) rotate(-2deg); }
  50% { transform: scale(var(--facing), .93) rotate(3deg); }
}
@keyframes tooFull {
  0%, 100% { transform: scaleX(var(--facing)); }
  24%, 68% { transform: scale(calc(1.07 * var(--facing)), .93) rotate(-4deg); }
  46% { transform: scale(calc(1.07 * var(--facing)), .93) rotate(4deg); }
}
@keyframes yawn {
  0%, 100% { transform: scaleX(var(--facing)); }
  23% { transform: scale(var(--facing), 1.035) rotate(-3deg); }
  62% { transform: scale(var(--facing), .98) rotate(3deg); }
}
@keyframes happyHop {
  0%, 100% { transform: scaleX(var(--facing)); }
  15%, 79% { transform: scale(calc(var(--facing) * 1.06), .92); }
  44% { transform: translateY(-8%) scale(calc(var(--facing) * .97), 1.045); }
}
.actor.is-anticipating > :is(.sprite-sheet, .sprite, .chibi) { animation: anticipate .16s ease-in-out both; }
@keyframes anticipate {
  from { transform: scaleX(var(--facing)); }
  to { transform: scale(calc(var(--facing) * 1.04), .95); }
}
.celebration { position: absolute; color: #ffc4db; text-shadow: 0 1px 4px #853857; animation: heartRise 1.45s ease-out forwards; }
.celebration:nth-child(even) { color: #ffe49c; }
.screen[data-scene="nacht"] .scene-art { background: #292641; }
.screen[data-scene="nacht"] .weather-sun::before { display: none; }
.speech {
  width: max-content; height: auto; min-width: 0; max-width: 41%; padding: 5px 7px;
  grid-auto-flow: column; gap: 4px; top: 34%; line-height: 1.15; pointer-events: none;
}
.speech img { width: 19px; height: 19px; }
.speech #speechEmoji { font-size: .95rem; }
.speech #speechText { font-size: clamp(.65rem, 1vw, .82rem); overflow-wrap: anywhere; }
.speech span:empty { display: none; }
.screen:has(.speech:not([hidden])) .screen-message { visibility: hidden; }
.level-up { pointer-events: none; }
.level-up.is-rank-up { inset: 9% 13% auto; padding: 6px 0; border-radius: 10px; }
.level-up.is-rank-up .level-stars { font-size: 1rem; }
.mute-button {
  margin-left: auto; flex: 0 0 auto; padding: 0 7px; min-height: 34px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--paper-3); color: var(--ink-2); font-size: .68rem; cursor: pointer;
}
.mute-button[aria-pressed="true"] { color: var(--rosegold); }
.device-controls { width: 100%; height: auto; }
.need[data-key="health"] .bar span { background: linear-gradient(90deg, #be587e, #ef9caa); }
.tama-details, .rank-exam { margin: 0; color: var(--ink-2); font-size: .72rem; }
.tama-details { display: flex; flex-wrap: wrap; gap: 3px 12px; }
.tama-details strong, .rank-exam { color: var(--rosegold); }
.status-footer { padding-inline-end: 0; }
.needs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (width < 760px) { .mute-button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) {
  .actor.is-angry { --reaction-motion: weakSway 1.1s ease-in-out infinite; }
  .mood-emoji { animation-name: moodEmojiFade; }
  .celebration { animation-duration: .7s; }
}
@keyframes moodEmojiFade {
  0%, 100% { opacity: 0; }
  20%, 65% { opacity: .9; }
}

/* Die Steuerung bleibt neben dem Gehäuse, auf schmalen Bildschirmen darunter. */
.screen-frame.tama-case {
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.screen-frame.tama-case::before { display: none; }
.screen-frame:is(:focus-within, .is-touched) .tama-case-art { filter: drop-shadow(0 0 8px #ef93af7d); }
.needs[hidden] { display: none; }
.status-card {
  gap: 9px;
  --paper-2: #281923;
  --paper-3: #3c2231;
  --line: #995e713f;
  --rose: #ef8fae;
  --lilac: #f1a9c5;
  --rosegold: #edbf8a;
}
.action.is-selected { background: #54273d; }
.screen-topline {
  inset: 15.1% 7% auto auto;
  gap: .6cqw;
  font-size: 1.65cqw;
}
.screen-topline span { padding: .32cqw .9cqw; border-radius: 4cqw; background: #3d1b27dc; }
.screen-message { left: 66%; bottom: 1.1%; max-width: 62%; font-size: 1.85cqw; }
.tama-case-screen .speech { grid-template-columns: auto minmax(0, 1fr); gap: .55cqw; }
.tama-case-screen .speech #speechText { grid-column: 2; }
.tama-case-screen .speech:not(:has(img.is-ready, #speechEmoji:not(:empty))) #speechText { grid-column: 1 / -1; }
.tama-case-screen .speech.is-angry { background: oklch(31% .1 25); }
.tama-case-screen .speech img { width: 3.2cqw; height: 3.2cqw; }
.tama-case-screen .speech #speechEmoji { font-size: 2.7cqw; }
.tama-case-screen .speech #speechText { font-size: 2.05cqw; line-height: 1.14; }
.tama-case-screen .event-prompt {
  top: 23%;
  width: 5cqw;
  height: 5cqw;
  font-size: 2.9cqw;
}
.tama-case-screen .event-prompt::after { font-size: 1.45cqw; }
.tama-case-screen .hc-hikari-reaction {
  inset: 66% auto auto 4%;
  width: 34%;
  overflow: hidden;
}
.tama-case-screen .hc-hikari-reaction .hc-hikari-panel {
  display: grid;
  position: relative;
  min-height: 8cqw;
  border: 1px solid #ba815b;
  border-radius: 1.9cqw;
  background: #4b1b2bf5;
}
.tama-case-screen .hc-hikari-reaction .hc-hikari-character { width: 29%; }
.tama-case-screen .hc-hikari-reaction .hc-hikari-note {
  position: relative;
  inset: auto;
  width: auto;
  max-height: none;
  padding: .55cqw .7cqw .55cqw 0;
  border: 0;
  background: none;
  font-size: 1.8cqw;
}
.tama-case-screen .hc-hikari-reaction .hc-hikari-title { font-size: 1.95cqw; }
.tama-case-screen .hc-hikari-reaction .hc-hikari-bubble { top: 6%; left: 24%; font-size: 1.9cqw; }
.tama-case-screen:has(.hc-hikari-reaction[data-companion-ready="yes"]:not([hidden])) > :is(.actor, .speech) { visibility: hidden; }
.tama-case-screen .hc-hikari-reaction[data-companion="yes"] { inset: 0; width: auto; }
.tama-case-screen .hc-hikari-reaction[data-companion="yes"] .hc-hikari-panel {
  display: block;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.tama-case-screen .hc-hikari-reaction[data-companion="yes"] .hc-hikari-scene-art { display: none; }
.tama-case-screen .hc-hikari-reaction[data-companion="yes"] .hc-hikari-character { inset: 0; width: 100%; }
.tama-case-screen .hc-hikari-reaction[data-companion="yes"] .hc-hikari-note {
  position: absolute;
  inset: auto auto 4% 4%;
  width: 34%;
  margin: 0;
  padding: .55cqw .7cqw;
  border-radius: 1.9cqw;
  background: #4b1b2bf5;
}
@media (min-width: 621px) and (orientation: landscape) and (max-height: 430px) {
  .status-card { gap: 5px; padding: 8px; }
  .status-card .profile { gap: 6px; }
  .status-card .profile h1 { font-size: .96rem; }
  .status-card .profile p { font-size: .7rem; }
  .status-card .profile .eyebrow { display: none; }
  .rank-portrait { width: 33px; }
  .device-button, .device-button.confirm, .mute-button { height: 33px; min-height: 33px; }
  .device-button, .device-button.confirm { width: 35px; }
  .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action { min-height: 43px; }
  .action-icon { width: 16px; height: 16px; }
  .evolution img { width: 25px; height: 25px; }
  .evolution li:not(:last-child)::after { top: 8px; }
  .status-note, .coin-note { font-size: .67rem; }
  .is-tama-embedded .status-footer { padding-inline-end: min(110px, 40%); }
}
@media (min-width: 621px) and (orientation: landscape) and (max-height: 320px) {
  .status-card { gap: 4px; padding: 6px; }
  .rank-portrait { width: 29px; }
  .device-button, .device-button.confirm, .mute-button { height: 28px; min-height: 28px; }
  .device-button, .device-button.confirm { width: 28px; }
  .actions { gap: 3px; }
  .action { min-height: 34px; grid-template-columns: auto minmax(0, max-content); justify-content: center; gap: 0 4px; }
  .action small { grid-column: 2; }
  .action small:empty { display: none; }
  .evolution img { width: 20px; height: 20px; }
}
@media (orientation: portrait), (max-width: 620px) {
  .game-shell { grid-template: auto auto / minmax(0, 1fr); min-block-size: 0; }
  .play-area { container-type: inline-size; grid-template-rows: auto; }
  .screen-frame { width: 100%; }
  .status-card { gap: 8px; }
  .is-tama-embedded { scrollbar-width: none; }
  .is-tama-embedded .game-shell { padding-block-end: 60px; }
}
@media (max-width: 460px) and (max-height: 720px) {
  .status-card { gap: 5px; padding: 8px; }
  .action { min-height: 44px; }
  .action-icon { width: 16px; height: 16px; }
  .evolution img { width: 26px; height: 26px; }
  .evolution li:not(:last-child)::after { top: 8px; }
  .status-note, .coin-note { font-size: .72rem; }
}

/* Innenräume haben ihr eigenes Licht und die neuen Sheets tragen ihre Bewegung selbst. */
.screen:is([data-scene="zimmer"], [data-scene="akademie"], [data-scene="ramen"]) .weather { display: none; }
.actor.is-normalized:not(.is-anticipating) > .sprite-sheet { animation: none; }
 
/* Beim Laden bleibt nur der neutrale Bildschirm sichtbar. */
#sceneArt:not(:has(img.is-ready)) { background: #291b2c; }
#sceneArt .scene-depth, #spriteFallback { display: none; }
.actor:not(.has-sheet):not(:has(.sprite.is-ready))::after { visibility: hidden; }

/* Die Web-Steuerung sitzt auf derselben Fläche wie das Gehäuse. */
:root {
  --paper: #171819;
  --paper-2: #304337;
  --paper-3: #3a5142;
  --line: #607869;
  --ink: #edf2e8;
  --ink-2: #d3e2d3;
  --ink-3: #a9bdac;
  --sage: #bed4b5;
}
.status-card {
  --rose: #bbd2b2;
  --lilac: #d5e6ca;
  --rosegold: #e6ca9d;
  border: 0;
  background: transparent;
}
.status-card::before { content: none; }
.status-card :is(.action, .device-button, .mute-button, .rank-portrait) {
  border-color: transparent;
  box-shadow: none;
}
.status-card .action { background: var(--paper-3); }
.status-card .action:hover { background: #46604d; box-shadow: none; }
.status-card .action.is-selected { color: #15241a; background: #bed4b5; }
.status-card .action.is-selected small { color: #294530; }
.status-card .action:focus-visible { outline-color: #e8f2e3; }

#sceneArt { filter: var(--tama-bg-light, brightness(1.06)); }
.screen.phase-evening:is([data-scene="ramen"], [data-scene="training"], [data-scene="natur"], [data-scene="mission"], [data-scene="akademie"], [data-scene="zimmer"]) #sceneArt {
  --tama-bg-light: brightness(.98) saturate(.98) sepia(.1);
  --tama-sky-grade: linear-gradient(155deg, #ee985926, #45205233);
}
.screen.phase-night:is([data-scene="ramen"], [data-scene="training"], [data-scene="natur"], [data-scene="mission"]) #sceneArt {
  --tama-bg-light: brightness(.88) saturate(.94);
  --tama-sky-grade: linear-gradient(155deg, #324c8d33, #1623484d);
}
