:root {
  color-scheme: light;
  --bg: #f8edda;
  --bg-strong: #f1d8ad;
  --panel: rgba(255, 250, 241, 0.82);
  --panel-solid: #fff8eb;
  --ink: #3d3429;
  --muted: #7a6b5b;
  --line: rgba(89, 66, 42, 0.16);
  --shadow: 0 22px 60px rgba(94, 58, 27, 0.16);
  --soft-shadow: 0 12px 28px rgba(94, 58, 27, 0.12);
  --cream: #fff7e7;
  --rice: #fbf1d4;
  --wood: #ba8054;
  --wood-dark: #7a4d32;
  --green: #78936d;
  --green-soft: #dfe9d5;
  --orange: #ed8f45;
  --orange-soft: #ffd8a5;
  --red: #d95843;
  --dark-glass: rgba(44, 35, 27, 0.78);
  --radius: 8px;
  --progress: 0;
  --heat: 0;
  --steam: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.55), transparent 28%),
    radial-gradient(circle at 20% 0%, rgba(255, 227, 173, 0.45), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #efd3a2 100%);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app {
  position: relative;
  min-height: 100vh;
  padding: 18px;
  isolation: isolate;
  transition:
    background-color 500ms ease,
    color 500ms ease;
}

.app.dark {
  color-scheme: dark;
  --bg: #181b1a;
  --bg-strong: #28302b;
  --panel: rgba(37, 39, 34, 0.82);
  --panel-solid: #252720;
  --ink: #f3ecdc;
  --muted: #c5b9a5;
  --line: rgba(255, 244, 223, 0.16);
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
  --soft-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  --cream: #343025;
  --rice: #f5e7bf;
  --wood: #a17452;
  --wood-dark: #6b4a35;
  --green: #9fb58e;
  --green-soft: #33402d;
  --orange: #f0a25b;
  --orange-soft: #67472b;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 50% -10%, rgba(240, 162, 91, 0.18), transparent 34%),
    linear-gradient(180deg, #151918 0%, #22231e 100%);
}

.app[data-theme="rainy"] {
  --bg: #e9ecdf;
  --bg-strong: #c5d2c2;
  --green: #6d8b7c;
  --orange: #dc8d4e;
}

.app[data-theme="winter"] {
  --bg: #edf0e9;
  --bg-strong: #d8e0d8;
  --green: #7c978a;
  --orange: #d98458;
}

.app[data-theme="spring"] {
  --bg: #f0ead2;
  --bg-strong: #dce9be;
  --green: #7fa36f;
  --orange: #e79456;
}

.app[data-theme="midnight"] {
  --bg: #171c1d;
  --bg-strong: #26332f;
  --panel: rgba(34, 38, 36, 0.84);
  --panel-solid: #222624;
  --ink: #f5eddd;
  --muted: #c7b9a3;
  --line: rgba(255, 241, 218, 0.16);
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.ambient-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 60, 34, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, transparent, black 20%, transparent 85%);
}

.window-glow {
  position: absolute;
  top: clamp(24px, 8vw, 96px);
  right: clamp(22px, 6vw, 90px);
  width: min(38vw, 470px);
  aspect-ratio: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background:
    linear-gradient(90deg, transparent 49%, rgba(117, 95, 74, 0.1) 50%, transparent 51%),
    linear-gradient(rgba(255, 244, 219, 0.72), rgba(245, 184, 112, 0.18));
  border-radius: 6px;
  box-shadow: inset 0 0 80px rgba(255, 248, 224, 0.46);
  transform: perspective(800px) rotateY(-12deg);
}

.counter-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14vh;
  height: 16vh;
  background:
    linear-gradient(90deg, rgba(129, 84, 46, 0.08), rgba(255, 251, 235, 0.14), rgba(129, 84, 46, 0.08)),
    linear-gradient(180deg, rgba(125, 84, 48, 0.18), rgba(91, 62, 40, 0.12));
  border-top: 1px solid rgba(91, 62, 40, 0.12);
}

.app-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  max-width: 1480px;
  margin: 0 auto 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #fffdf4, #f3d397);
  box-shadow: var(--soft-shadow);
}

.brand-mark span {
  width: 16px;
  height: 23px;
  border-radius: 50% 50% 46% 46%;
  background: linear-gradient(160deg, #fff8df, #dfbc74);
  transform: rotate(28deg);
  border: 1px solid rgba(102, 77, 42, 0.18);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.header-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  backdrop-filter: blur(16px);
}

.header-stats b {
  color: var(--ink);
  margin-right: 4px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 250, 241, 0.62);
  box-shadow: 0 5px 18px rgba(91, 62, 40, 0.08);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
}

.icon-button:active {
  transform: translateY(1px) scale(0.98);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button.filled {
  color: #fffdf5;
  background: var(--green);
  border-color: transparent;
}

.layout {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(370px, 1fr) minmax(270px, 340px);
  gap: 18px;
  max-width: 1480px;
  margin: 0 auto;
  align-items: stretch;
}

.panel,
.cooker-stage {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.panel {
  padding: 18px;
}

.cooker-stage {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 106px);
  padding: clamp(16px, 2.4vw, 28px);
  overflow: hidden;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

.eyebrow {
  display: inline-block;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 6px;
  font-size: clamp(1.65rem, 5vw, 2.55rem);
  line-height: 1.02;
  max-width: 11ch;
}

h2 {
  margin-top: 5px;
  font-size: clamp(1.12rem, 2.6vw, 1.5rem);
  line-height: 1.15;
}

fieldset {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

legend,
.select-row span,
.range-row span,
.notes-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.duration-grid,
.segmented {
  display: grid;
  gap: 8px;
}

.duration-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice,
.primary-action,
.secondary-action,
.text-button,
.ritual-step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 170ms ease,
    background-color 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease;
}

.choice {
  min-height: 42px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
  font-weight: 750;
  font-size: 0.88rem;
}

.choice.selected {
  color: var(--ink);
  border-color: rgba(120, 147, 109, 0.42);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.choice-surprise {
  grid-column: 1 / -1;
  letter-spacing: 0.02em;
}

.choice:hover,
.ritual-step:hover,
.secondary-action:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.range-row {
  display: grid;
  grid-template-columns: auto 1fr 3ch;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.range-row span {
  margin: 0;
}

.range-row b {
  text-align: right;
}

input[type="range"] {
  accent-color: var(--green);
}

.select-row {
  display: block;
  margin-bottom: 14px;
}

select,
input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  outline: none;
  transition:
    box-shadow 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

select {
  min-height: 42px;
  padding: 0 12px;
}

input[type="text"] {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 110px;
  padding: 12px;
  line-height: 1.45;
}

select:focus,
input[type="text"]:focus,
textarea:focus {
  border-color: rgba(120, 147, 109, 0.62);
  box-shadow: 0 0 0 4px rgba(120, 147, 109, 0.15);
  background: rgba(255, 255, 255, 0.72);
}

.ritual-card {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 247, 231, 0.62);
}

.ritual-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  text-align: left;
}

.ritual-step:disabled,
.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.step-dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(122, 107, 91, 0.34);
  border-radius: 50%;
  background: var(--panel-solid);
}

.ritual-step.done {
  color: var(--ink);
  border-color: rgba(120, 147, 109, 0.34);
  background: var(--green-soft);
}

.ritual-step.done .step-dot {
  border-color: var(--green);
  background: radial-gradient(circle, var(--green) 0 42%, transparent 45%);
}

.primary-action,
.secondary-action,
.text-button {
  min-height: 44px;
  padding: 0 15px;
  font-weight: 800;
}

.primary-action {
  color: #fffdf6;
  background: linear-gradient(180deg, #ef9d57, #d86f3f);
  border-color: rgba(125, 67, 32, 0.18);
  box-shadow: 0 12px 26px rgba(216, 111, 63, 0.28);
}

.primary-action:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(216, 111, 63, 0.34);
}

.secondary-action {
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
}

.text-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--green);
  background: transparent;
}

.stage-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.timer-readout {
  min-width: 5.3ch;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 850;
  line-height: 1;
  text-align: right;
}

.cooker-scene {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 440px;
  place-items: center;
  padding: 20px 0 46px;
}

#steamCanvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.progress-halo {
  position: absolute;
  width: min(78%, 560px);
  max-width: 620px;
  aspect-ratio: 1;
  z-index: 0;
  opacity: 0.9;
}

.progress-halo svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.halo-track,
.halo-progress {
  fill: none;
  stroke-width: 6;
}

.halo-track {
  stroke: rgba(120, 147, 109, 0.14);
}

.halo-progress {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 666;
  stroke-dashoffset: calc(666 - (666 * var(--progress)));
  filter: drop-shadow(0 0 14px rgba(120, 147, 109, 0.22));
  transition: stroke-dashoffset 420ms linear;
}

.rice-cooker {
  --shake: 0;
  position: relative;
  width: min(76vw, 420px);
  height: min(76vw, 420px);
  max-height: 480px;
  z-index: 2;
  transform: translateY(8px);
  animation: cooker-breathe 3.8s ease-in-out infinite;
  filter: drop-shadow(0 34px 40px rgba(76, 52, 32, 0.22));
}

.app[data-state="cooking"] .rice-cooker,
.app[data-state="steaming"] .rice-cooker {
  animation:
    cooker-breathe 3.2s ease-in-out infinite,
    cooker-work 920ms ease-in-out infinite;
}

.app[data-state="simmering"] .rice-cooker {
  animation:
    cooker-breathe 2.5s ease-in-out infinite,
    cooker-work 520ms ease-in-out infinite;
}

.lid {
  position: absolute;
  left: 13%;
  top: 6%;
  width: 74%;
  height: 26%;
  border-radius: 48% 48% 18% 18% / 72% 72% 28% 28%;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.96), rgba(250, 237, 211, 0.98) 42%, rgba(219, 198, 169, 0.95)),
    var(--cream);
  border: 1px solid rgba(88, 68, 48, 0.16);
  box-shadow:
    inset 0 10px 22px rgba(255, 255, 255, 0.54),
    inset 0 -10px 22px rgba(140, 96, 54, 0.12),
    0 12px 28px rgba(72, 49, 32, 0.12);
  transform-origin: 50% 92%;
  z-index: 4;
}

.app[data-state="simmering"] .lid {
  animation: lid-rattle 330ms ease-in-out infinite;
}

.app[data-state="popped"] .lid {
  animation: lid-pop 900ms cubic-bezier(0.16, 1.25, 0.42, 1) both;
}

.lid-handle {
  position: absolute;
  left: 50%;
  top: -16%;
  width: 30%;
  height: 30%;
  border-radius: 52% 52% 34% 34%;
  background: linear-gradient(180deg, #fdf5df, #d3b58b);
  border: 1px solid rgba(82, 61, 42, 0.18);
  transform: translateX(-50%);
  box-shadow: inset 0 5px 10px rgba(255, 255, 255, 0.52);
}

.lid-shine {
  position: absolute;
  left: 13%;
  top: 22%;
  width: 40%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.54);
  filter: blur(2px);
}

.body {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 11%;
  height: 68%;
  border-radius: 25% 25% 18% 18% / 18% 18% 22% 22%;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.95), transparent 14%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.96), rgba(239, 224, 198, 0.98) 42%, rgba(205, 178, 148, 0.96));
  border: 1px solid rgba(86, 65, 46, 0.16);
  box-shadow:
    inset 0 12px 32px rgba(255, 255, 255, 0.56),
    inset 0 -28px 42px rgba(130, 86, 46, calc(0.1 + (var(--heat) * 0.12))),
    0 18px 48px rgba(75, 51, 34, 0.2);
  transition: box-shadow 600ms ease;
  z-index: 2;
}

.body::after {
  content: "";
  position: absolute;
  inset: auto 10% 7% 10%;
  height: 10%;
  border-radius: 50%;
  background: rgba(92, 58, 34, 0.08);
  filter: blur(7px);
}

.body-shine {
  position: absolute;
  left: 10%;
  top: 20%;
  width: 18%;
  height: 48%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  filter: blur(5px);
  transform: rotate(9deg);
}

.pot-window {
  position: absolute;
  left: 22%;
  top: 33%;
  width: 34%;
  height: 35%;
  overflow: hidden;
  border: 7px solid rgba(62, 47, 36, 0.18);
  border-radius: 42% 42% 36% 36%;
  background:
    linear-gradient(180deg, rgba(192, 227, 220, 0.54), rgba(255, 243, 205, 0.54)),
    rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 4px 18px rgba(255, 255, 255, 0.65),
    inset 0 -18px 18px rgba(190, 156, 89, 0.18);
  z-index: 5;
}

.water-line {
  position: absolute;
  left: -8%;
  right: -8%;
  top: calc(28% + (1 - var(--progress)) * 22%);
  height: 44%;
  background:
    repeating-radial-gradient(circle at 20% 70%, rgba(255, 255, 255, 0.5) 0 2px, transparent 3px 17px),
    linear-gradient(180deg, rgba(177, 221, 214, 0.66), rgba(232, 213, 157, 0.56));
  border-radius: 50% 50% 18% 18%;
  opacity: calc(0.8 - (var(--progress) * 0.42));
  transform: rotate(-1deg);
  animation: water-wobble 2.3s ease-in-out infinite;
}

.rice-bed {
  position: absolute;
  left: -7%;
  right: -7%;
  bottom: -8%;
  height: calc(30% + (var(--progress) * 30%));
  border-radius: 52% 52% 14% 14%;
  background:
    radial-gradient(ellipse at 20% 16%, rgba(255, 255, 255, 0.9) 0 4px, transparent 5px),
    radial-gradient(ellipse at 70% 22%, rgba(255, 255, 255, 0.84) 0 3px, transparent 4px),
    radial-gradient(ellipse at 44% 8%, rgba(255, 255, 255, 0.86) 0 3px, transparent 4px),
    linear-gradient(180deg, var(--rice), #e8c983);
  background-size: 46px 22px, 38px 24px, 34px 18px, 100% 100%;
  filter: saturate(calc(0.9 + var(--progress) * 0.35)) brightness(calc(0.93 + var(--progress) * 0.12));
  transition: height 500ms ease;
}

.rice-bed.black {
  --rice: #5b4e58;
  background:
    radial-gradient(ellipse at 20% 16%, rgba(232, 220, 224, 0.54) 0 3px, transparent 4px),
    radial-gradient(ellipse at 70% 22%, rgba(232, 220, 224, 0.48) 0 3px, transparent 4px),
    linear-gradient(180deg, #6f6070, #332b33);
}

.rice-bed.brown {
  --rice: #d9bd83;
}

.bubbles {
  position: absolute;
  inset: 12% 6% 18%;
  opacity: calc(0.2 + var(--steam) * 0.8);
}

.bubbles span {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  opacity: 0;
  animation: bubble-rise 2.2s ease-in infinite;
}

.bubbles span:nth-child(1) {
  left: 12%;
  animation-delay: 0ms;
}

.bubbles span:nth-child(2) {
  left: 28%;
  width: 6px;
  height: 6px;
  animation-delay: 530ms;
}

.bubbles span:nth-child(3) {
  left: 48%;
  width: 10px;
  height: 10px;
  animation-delay: 860ms;
}

.bubbles span:nth-child(4) {
  left: 63%;
  animation-delay: 280ms;
}

.bubbles span:nth-child(5) {
  left: 77%;
  width: 7px;
  height: 7px;
  animation-delay: 1130ms;
}

.bubbles span:nth-child(6) {
  left: 39%;
  width: 5px;
  height: 5px;
  animation-delay: 1450ms;
}

.control-panel {
  position: absolute;
  right: 11%;
  top: 36%;
  display: grid;
  gap: 8px;
  min-width: 104px;
  padding: 12px;
  border: 1px solid rgba(87, 61, 42, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 252, 244, 0.92), rgba(214, 192, 164, 0.86));
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.55);
}

.indicator-row {
  display: grid;
  grid-template-columns: 15px 1fr;
  align-items: center;
  gap: 7px;
  color: rgba(73, 55, 40, 0.8);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.indicator {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(70, 48, 33, 0.18);
  background: #d6c8b6;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.16);
}

.app[data-state="heating"] .cook-light,
.app[data-state="cooking"] .cook-light,
.app[data-state="steaming"] .cook-light,
.app[data-state="simmering"] .cook-light {
  background: var(--red);
  box-shadow:
    0 0 16px rgba(217, 88, 67, 0.74),
    inset 0 1px 3px rgba(255, 255, 255, 0.35);
}

.app[data-state="warming"] .warm-light,
.app[data-state="popped"] .warm-light {
  background: #81a76c;
  box-shadow:
    0 0 16px rgba(129, 167, 108, 0.7),
    inset 0 1px 3px rgba(255, 255, 255, 0.35);
}

.cooker-switch {
  position: relative;
  width: 54px;
  height: 36px;
  justify-self: center;
  margin-top: 3px;
  border: 1px solid rgba(72, 51, 34, 0.2);
  border-radius: 8px;
  background: rgba(94, 70, 51, 0.18);
  cursor: default;
}

.cooker-switch span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 18px;
  height: 27px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f8efe1, #c89d72);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.56),
    0 5px 9px rgba(70, 44, 28, 0.18);
  transform: translateX(-50%) translateY(7px);
  transition: transform 220ms ease;
}

.app[data-state="popped"] .cooker-switch span,
.app[data-state="warming"] .cooker-switch span {
  transform: translateX(-50%) translateY(-4px);
}

.app[data-state="popped"] .cooker-switch span {
  animation: switch-pop 620ms cubic-bezier(0.18, 1.4, 0.32, 1) both;
}

.feet {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 7%;
  display: flex;
  justify-content: space-between;
  z-index: 1;
}

.feet span {
  width: 58px;
  height: 28px;
  border-radius: 9px 9px 18px 18px;
  background: linear-gradient(180deg, #c5aa88, #7f5b40);
}

.heat-pad {
  position: absolute;
  bottom: 8%;
  width: min(58vw, 470px);
  height: 76px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse, rgba(237, 143, 69, calc(0.14 + var(--heat) * 0.32)), transparent 66%),
    rgba(89, 54, 31, 0.08);
  filter: blur(2px);
  transform: translateY(18px);
  z-index: 1;
}

.session-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 5;
}

.focus-quote {
  min-height: 32px;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.task-form {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
}

.task-list {
  display: grid;
  gap: 8px;
  min-height: 86px;
  max-height: 180px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
  overflow: auto;
}

.task-item {
  display: grid;
  grid-template-columns: 28px 1fr 30px;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
}

.task-item label {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-item input {
  accent-color: var(--green);
}

.task-item.completed label {
  color: var(--muted);
  text-decoration: line-through;
}

.task-remove {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.task-remove:hover {
  color: var(--red);
  background: rgba(217, 88, 67, 0.1);
}

.focus-options {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.focus-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

.focus-options input {
  accent-color: var(--green);
}

.progress-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 248, 230, 0.56);
}

.progress-copy {
  display: grid;
  gap: 3px;
}

.progress-copy strong {
  line-height: 1.2;
}

.progress-copy span:last-child {
  color: var(--muted);
  font-size: 0.85rem;
}

.xp-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(89, 66, 42, 0.12);
}

.xp-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--orange));
  transition: width 500ms ease;
}

.inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory span,
.recipe {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
}

.inventory span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.recipe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recipe {
  min-height: 68px;
  padding: 9px;
  overflow: hidden;
}

.recipe strong,
.recipe span {
  display: block;
  line-height: 1.2;
}

.recipe strong {
  font-size: 0.85rem;
}

.recipe span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.recipe.locked {
  filter: saturate(0.2);
  opacity: 0.58;
}

.reward-sheet {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(55, 42, 31, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 20;
}

.reward-sheet.open {
  opacity: 1;
  pointer-events: auto;
}

.reward-card {
  position: relative;
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: 0 30px 90px rgba(42, 28, 18, 0.32);
  text-align: center;
}

.close-button {
  position: absolute;
  right: 14px;
  top: 14px;
}

.finished-bowl {
  position: relative;
  width: 190px;
  height: 122px;
  margin: 4px auto 16px;
}

.finished-bowl::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 55%;
  border-radius: 16% 16% 48% 48%;
  background: linear-gradient(180deg, #f6f0df, #cfa56f);
  box-shadow:
    inset 0 8px 16px rgba(255, 255, 255, 0.42),
    0 16px 26px rgba(78, 49, 26, 0.16);
}

.bowl-rice {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 4%;
  height: 68%;
  border-radius: 50% 50% 32% 32%;
  background:
    radial-gradient(ellipse at 24% 22%, #fffdf2 0 5px, transparent 6px),
    radial-gradient(ellipse at 54% 30%, #fffdf2 0 5px, transparent 6px),
    radial-gradient(ellipse at 72% 18%, #fffdf2 0 4px, transparent 5px),
    linear-gradient(180deg, #fff8df, #ead08c);
}

.topping {
  position: absolute;
  display: block;
  border-radius: 50%;
  box-shadow: 0 3px 5px rgba(74, 48, 30, 0.14);
}

.topping-one {
  left: 42%;
  top: 22%;
  width: 24px;
  height: 24px;
  background: #f1bf55;
}

.topping-two {
  left: 58%;
  top: 34%;
  width: 34px;
  height: 14px;
  border-radius: 12px;
  background: #df8065;
  transform: rotate(-14deg);
}

.topping-three {
  left: 31%;
  top: 40%;
  width: 18px;
  height: 18px;
  background: #6f9b5d;
}

.reward-card p {
  margin: 10px auto 0;
  max-width: 34ch;
  color: var(--muted);
}

.reward-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.reward-stats div {
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
}

.reward-stats dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reward-stats dd {
  margin: 4px 0 0;
  font-weight: 850;
}

.reward-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shield {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at center, rgba(255, 248, 226, 0.14), transparent 34%),
    rgba(24, 22, 18, 0.86);
  opacity: 0;
  pointer-events: none;
  z-index: 16;
  transition: opacity 260ms ease;
}

.shield.active {
  opacity: 1;
  pointer-events: auto;
}

.shield div {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: #fff7e6;
  background: rgba(35, 30, 24, 0.58);
  text-align: center;
}

.shield strong {
  font-variant-numeric: tabular-nums;
  font-size: clamp(3rem, 18vw, 7rem);
  line-height: 0.95;
}

.focus-mode .setup-panel,
.focus-mode .focus-panel,
.focus-mode .app-header {
  display: none;
}

.focus-mode .layout {
  grid-template-columns: 1fr;
  max-width: 980px;
}

.focus-mode .cooker-stage {
  min-height: calc(100vh - 36px);
}

@keyframes cooker-breathe {
  0%,
  100% {
    transform: translateY(8px) scale(1);
  }
  50% {
    transform: translateY(3px) scale(1.004);
  }
}

@keyframes cooker-work {
  0%,
  100% {
    margin-left: 0;
  }
  25% {
    margin-left: calc(var(--steam) * -2px);
  }
  75% {
    margin-left: calc(var(--steam) * 2px);
  }
}

@keyframes lid-rattle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  30% {
    transform: rotate(-0.45deg) translateY(-1px);
  }
  70% {
    transform: rotate(0.45deg) translateY(1px);
  }
}

@keyframes lid-pop {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  38% {
    transform: translateY(-15px) rotate(-1.4deg);
  }
  65% {
    transform: translateY(-7px) rotate(0.8deg);
  }
  100% {
    transform: translateY(-10px) rotate(0deg);
  }
}

@keyframes switch-pop {
  0% {
    transform: translateX(-50%) translateY(7px);
  }
  48% {
    transform: translateX(-50%) translateY(-9px);
  }
  100% {
    transform: translateX(-50%) translateY(-4px);
  }
}

@keyframes water-wobble {
  0%,
  100% {
    transform: translateX(-1px) rotate(-1deg);
  }
  50% {
    transform: translateX(2px) rotate(1deg);
  }
}

@keyframes bubble-rise {
  0% {
    transform: translateY(16px) scale(0.55);
    opacity: 0;
  }
  18% {
    opacity: calc(0.22 + var(--steam) * 0.68);
  }
  100% {
    transform: translateY(-68px) scale(1.2);
    opacity: 0;
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(270px, 0.95fr) minmax(410px, 1.35fr);
  }

  .focus-panel {
    grid-column: 1 / -1;
  }

  .cooker-stage {
    min-height: 660px;
  }

  .focus-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 16px;
  }

  .focus-panel .panel-heading,
  .focus-panel .task-form,
  .focus-panel .task-list,
  .focus-panel .notes-label,
  .focus-panel textarea {
    grid-column: 1;
  }

  .focus-options,
  .progress-card,
  .recipes {
    grid-column: 2;
  }
}

@media (max-width: 820px) {
  .app {
    padding: 12px;
  }

  .app-header {
    grid-template-columns: 1fr auto;
  }

  .header-stats {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel,
  .cooker-stage {
    border-radius: 8px;
  }

  .setup-panel {
    order: 1;
  }

  .cooker-stage {
    order: 2;
    min-height: auto;
  }

  .focus-panel {
    order: 3;
    display: block;
  }

  h1 {
    max-width: 14ch;
  }

  .cooker-scene {
    min-height: 380px;
    padding-bottom: 36px;
  }

  .rice-cooker {
    width: min(84vw, 360px);
    height: min(84vw, 360px);
  }

  .duration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented,
  .session-controls,
  .reward-actions,
  .reward-stats {
    grid-template-columns: 1fr;
  }

  .stage-topline {
    align-items: center;
  }

  .timer-readout {
    font-size: clamp(1.75rem, 9vw, 2.7rem);
  }
}

@media (max-width: 520px) {
  .app-header {
    align-items: start;
  }

  .brand small {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .stage-topline {
    display: grid;
  }

  .timer-readout {
    width: 100%;
    text-align: center;
  }

  .cooker-scene {
    min-height: 340px;
  }

  .control-panel {
    right: 8%;
    min-width: 90px;
    padding: 9px;
  }

  .pot-window {
    border-width: 5px;
  }
}

/* ── Volume row ─────────────────────────────────────────────────────────────── */

.volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.volume-row svg {
  flex-shrink: 0;
  color: var(--muted);
}

.volume-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--green);
}

/* ── Recipe header actions ──────────────────────────────────────────────────── */

.recipe-header-actions {
  display: flex;
  gap: 2px;
}

/* ── Notify button active state ─────────────────────────────────────────────── */

#notifyBtn.active {
  border-color: rgba(120, 147, 109, 0.42);
  background: var(--green-soft);
}

/* ── Break timer in reward sheet ────────────────────────────────────────────── */

.break-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.28);
}

.break-action {
  flex-shrink: 0;
  font-size: 0.85rem;
  min-height: 36px;
  padding: 0 12px;
}

.break-timer-label {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

.ad-banner {
  margin: 12px 0;
  min-height: 60px;
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
}

.reward-skip {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ── History modal ──────────────────────────────────────────────────────────── */

.history-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(55, 42, 31, 0.44);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
  z-index: 22;
}

.history-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.history-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: 0 30px 90px rgba(42, 28, 18, 0.32);
  overflow: hidden;
}

.history-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.history-header h2 {
  font-size: 1.05rem;
  margin: 0;
}

.history-stats-bar {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 230, 0.42);
  font-size: 0.78rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.history-stats-bar strong {
  color: var(--ink);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 20px 20px;
  overscroll-behavior: contain;
}

.history-group {
  margin-top: 14px;
}

.history-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.history-day-total {
  font-weight: 700;
  color: var(--muted);
}

.history-item {
  display: grid;
  grid-template-columns: 5.5ch 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

.history-item:last-child { border-bottom: 0; }

.history-time {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.history-detail {
  color: var(--ink);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-xp {
  color: var(--green);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

.history-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
