:root {
  --ink: #171717;
  --paper: #f4f1e8;
  --panel: #fffdf7;
  --acid: #d8ff62;
  --blue: #83b7ff;
  --coral: #ff8b6b;
  --lulu-yellow: #ffd85b;
  --lulu-orange: #ff9b35;
  --lulu-green: #a7c874;
  --muted: #706d65;
  --line: #232323;
  --soft-line: #c9c4b7;
  --shadow: 8px 8px 0 var(--ink);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
label:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.app-shell {
  position: relative;
  z-index: 2;
  width: min(900px, calc(100% - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 62px 0 34px;
}

.site-header {
  position: relative;
  text-align: center;
}

.site-header > *:not(.lulu-hero) {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 13px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.2em;
}

h1 {
  max-width: 780px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 9vw, 6.8rem);
  font-weight: 500;
  line-height: 0.83;
  letter-spacing: -0.075em;
}

.credit {
  margin: 21px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-style: italic;
}

.credit a {
  color: inherit;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.lulu-hero {
  position: absolute;
  z-index: 1;
  top: 36px;
  right: -88px;
  width: 176px;
  height: auto;
  filter: drop-shadow(6px 8px 0 rgba(23, 23, 23, 0.16));
  transform: rotate(5deg);
  animation: lulu-float 3.2s ease-in-out infinite alternate;
}

.selectors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 42px 0 28px;
}

.segment {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.segment-button {
  min-width: 92px;
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 750;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.segment-button:hover:not(.is-active) {
  color: var(--ink);
  transform: translateY(-1px);
}

.segment-button.is-active {
  color: var(--ink);
  background: var(--acid);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.segment-categories .segment-button.is-active {
  background: var(--lulu-yellow);
}

.category-row {
  display: flex;
  width: min(720px, 100%);
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.category-row .segment-categories {
  flex: 1;
}

.category-row .segment-button {
  min-width: 0;
  flex: 1;
}

.visibility-button {
  min-width: 146px;
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  transition: transform 150ms ease, background 150ms ease;
}

.visibility-button:hover {
  transform: translateY(-1px);
}

.visibility-button.is-visible {
  background: var(--lulu-orange);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.practice-area {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
}

.prompt-panel,
.timer-panel {
  position: relative;
  min-height: 330px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.prompt-panel {
  display: flex;
  flex-direction: column;
  margin-top: 100px;
  padding: clamp(23px, 4vw, 38px);
  overflow: hidden;
}

.prompt-panel::after {
  position: absolute;
  right: -31px;
  bottom: -39px;
  width: 112px;
  height: 112px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--lulu-orange);
  content: "";
  pointer-events: none;
}

.lulu-card-button {
  position: absolute;
  z-index: 4;
  top: -38px;
  left: 18px;
  width: 126px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.lulu-card-button::after {
  position: absolute;
  top: 4px;
  left: 91px;
  width: max-content;
  padding: 7px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 12px 12px 12px 2px;
  background: var(--acid);
  content: "LET'S GO!";
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-7px, 7px) rotate(-5deg) scale(0.75);
}

.lulu-card {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(3px 5px 0 rgba(23, 23, 23, 0.18));
  animation: lulu-card-bob 2.7s ease-in-out infinite alternate;
}

.lulu-card-button.is-cheering .lulu-card {
  animation: lulu-cheer 760ms cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

.lulu-card-button.is-cheering::after {
  animation: lulu-bubble-pop 820ms ease both;
}

.prompt-panel.is-spinning {
  animation: panel-nudge 340ms ease-in-out infinite alternate;
}

.panel-meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.panel-meta > :first-child {
  margin-left: 116px;
}

.prompt-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 28px 12px 22px 0;
}

.ready-kicker,
.question-kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ready-title,
.question-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.question-title {
  max-width: 680px;
  font-size: clamp(1.8rem, 4.7vw, 3.35rem);
  line-height: 1.04;
}

.ready-copy,
.empty-copy {
  max-width: 450px;
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.question-list {
  display: grid;
  gap: 11px;
  margin: 23px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: prompt-item;
}

.question-list li {
  position: relative;
  padding-left: 31px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2.4vw, 1.35rem);
  line-height: 1.35;
  counter-increment: prompt-item;
}

.question-list li::before {
  position: absolute;
  top: 0.12em;
  left: 0;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  content: counter(prompt-item);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 0.66rem;
  font-weight: 850;
}

.cue-label {
  margin: 24px 0 0;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spinning-line {
  display: -webkit-box;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.result-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 8px 64px 0 0;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.result-strip strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.button {
  min-height: 58px;
  padding: 15px 25px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 850;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

.button:hover:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.button:active:not(:disabled) {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--ink);
}

.button:disabled {
  border-color: #aaa69c;
  color: #8e8a80;
  background: #dedbd2;
  box-shadow: 4px 4px 0 #aaa69c;
  cursor: not-allowed;
}

.button-draw {
  background: var(--acid);
}

.button-start {
  background: var(--blue);
}

.button-stop {
  width: min(260px, 80%);
  margin: 18px auto 0;
  background: var(--coral);
}

.helper-text {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.timer-panel {
  display: flex;
  min-height: 530px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px 30px;
}

.timer-question {
  display: -webkit-box;
  width: min(610px, 100%);
  min-height: 2.8em;
  margin: 0 auto 8px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  line-height: 1.4;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.timer-question.is-concealed {
  visibility: hidden;
}

.timer-ring-wrap {
  position: relative;
  width: min(330px, 78vw);
  aspect-ratio: 1;
}

.timer-ring {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track,
.timer-progress {
  fill: none;
  stroke-width: 13;
}

.timer-track {
  stroke: #dfdbd0;
}

.timer-progress {
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-dasharray: 804.25;
  stroke-dashoffset: 0;
  transition: stroke 200ms ease;
}

.timer-ring-wrap.is-prep .timer-progress { stroke: var(--acid); }
.timer-ring-wrap.is-overtime .timer-progress { stroke: var(--coral); }

.timer-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-phase {
  margin-bottom: 7px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.timer-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 11vw, 6.6rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.site-footer {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin-top: 25px;
  color: var(--muted);
  font-size: 0.76rem;
}

.utility-button {
  padding: 4px 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.bank-status {
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decor {
  position: fixed;
  z-index: 0;
  pointer-events: none;
}

.decor-dot {
  top: 10vh;
  left: max(20px, calc(50vw - 520px));
  width: 62px;
  height: 62px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--lulu-orange);
  transform: rotate(-8deg) scaleX(1.18);
}

.decor-dot::after {
  position: absolute;
  top: -13px;
  left: 25px;
  width: 16px;
  height: 21px;
  border: 2px solid var(--ink);
  border-radius: 80% 10% 80% 10%;
  background: var(--lulu-green);
  content: "";
  transform: rotate(28deg);
}

.decor-star {
  top: 180px;
  right: max(28px, calc(50vw - 520px));
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 4rem;
  line-height: 1;
  transform: rotate(15deg);
}

.decor-ring {
  right: max(-35px, calc(50vw - 610px));
  bottom: 13vh;
  width: 115px;
  height: 115px;
  border: 18px solid var(--acid);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 2px var(--ink);
}

[hidden] {
  display: none !important;
}

@keyframes panel-nudge {
  from { transform: translateX(-1px) rotate(-0.08deg); }
  to { transform: translateX(1px) rotate(0.08deg); }
}

@keyframes lulu-float {
  from { transform: translateY(-3px) rotate(4deg); }
  to { transform: translateY(7px) rotate(7deg); }
}

@keyframes lulu-card-bob {
  from { transform: translateY(0) rotate(-7deg); }
  to { transform: translateY(5px) rotate(-2deg); }
}

@keyframes lulu-cheer {
  0% { transform: translateY(0) rotate(-6deg) scale(1); }
  28% { transform: translateY(-17px) rotate(8deg) scale(1.08, 0.94); }
  52% { transform: translateY(2px) rotate(-9deg) scale(0.96, 1.06); }
  74% { transform: translateY(-6px) rotate(5deg) scale(1.03); }
  100% { transform: translateY(0) rotate(-5deg) scale(1); }
}

@keyframes lulu-bubble-pop {
  0%, 100% { opacity: 0; transform: translate(-7px, 7px) rotate(-5deg) scale(0.75); }
  20%, 72% { opacity: 1; transform: translate(0, 0) rotate(2deg) scale(1); }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 24px, 620px);
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(3.1rem, 17vw, 5.2rem);
  }

  .selectors {
    margin-top: 34px;
  }

  .segment {
    width: 100%;
  }

  .category-row {
    gap: 7px;
  }

  .category-row .segment-categories {
    width: auto;
  }

  .visibility-button {
    min-width: 116px;
    padding-inline: 8px;
    font-size: 0.72rem;
  }

  .segment-button {
    min-width: 0;
    flex: 1;
    padding-inline: 9px;
  }

  .prompt-panel {
    min-height: 350px;
    margin-top: 80px;
    border-radius: 22px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .panel-meta {
    font-size: 0.61rem;
  }

  .panel-meta > :first-child {
    margin-left: 82px;
  }

  .actions {
    gap: 10px;
  }

  .button {
    min-height: 54px;
    padding-inline: 12px;
  }

  .timer-panel {
    min-height: 500px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .lulu-hero {
    display: none;
  }

  .lulu-card-button {
    top: -27px;
    left: 12px;
    width: 98px;
  }

  .lulu-card-button::after {
    top: 1px;
    left: 69px;
    padding: 5px 7px;
    font-size: 0.56rem;
  }

  .site-footer {
    flex-wrap: wrap;
  }

  .bank-status {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .decor {
    opacity: 0.55;
  }

  .decor-dot {
    top: 18px;
    left: -24px;
  }

  .decor-star {
    top: 112px;
    right: -7px;
    font-size: 3rem;
  }

  .decor-ring {
    display: none;
  }
}

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