:root {
  color-scheme: light;
  --paper: #f7ecd2;
  --ink: #16120d;
  --muted: #6f6253;
  --desk: #f0c05a;
  --desk-dark: #bb7435;
  --green: #28a66a;
  --red: #e2513f;
  --blue: #457bdc;
  --pink: #f28eb2;
  --shadow: rgba(22, 18, 13, 0.18);
  --border: 4px solid var(--ink);
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(22, 18, 13, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(22, 18, 13, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
}

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

button {
  font: inherit;
}

a {
  color: inherit;
  font-weight: 900;
  text-decoration-thickness: 2px;
}

.app {
  min-height: 100svh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
}

.screen {
  width: min(100%, 430px, calc((100svh - 16px) * 0.59));
  height: min(calc(100svh - 16px), 790px);
  min-height: min(640px, calc(100svh - 16px));
  display: flex;
  flex-direction: column;
  position: relative;
}

.is-hidden {
  display: none !important;
}

.brand-row,
.footer-line,
.status-row,
.game-header,
.result-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-toggle {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: #fffdf7;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  font-size: 1.18rem;
  line-height: 1;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.sound-toggle[aria-pressed="true"] {
  background: #ffd9d4;
}

.sound-toggle:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.sound-toggle:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 3px;
}

.brand-row {
  font-size: 0.84rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 3px 3px 0 var(--ink);
}

.title-stack {
  margin: clamp(22px, 5svh, 42px) 0 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 8ch;
  margin-bottom: 14px;
  font-size: clamp(4rem, 19vw, 6.6rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 7vw, 2.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.tagline {
  max-width: 17rem;
  color: var(--muted);
  font-size: clamp(1.08rem, 4vw, 1.3rem);
  font-weight: 800;
  line-height: 1.25;
}

.hero-desk {
  flex: 0 0 clamp(210px, 34svh, 280px);
  min-height: 0;
  position: relative;
  margin: 6px 0 22px;
}

.monitor {
  width: min(78%, 340px);
  aspect-ratio: 1.45;
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%) rotate(-1.5deg);
  border: var(--border);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 7px 7px 0 var(--ink);
  overflow: hidden;
}

.monitor::after {
  content: "";
  width: 90px;
  height: 36px;
  position: absolute;
  left: calc(50% - 45px);
  bottom: -30px;
  border: var(--border);
  border-bottom: 0;
  background: #d8dce6;
}

.monitor-bar,
.monitor-row,
.monitor-alert {
  position: absolute;
  left: 22px;
  right: 22px;
  border: 3px solid var(--ink);
  border-radius: 999px;
}

.monitor-bar {
  top: 22px;
  height: 28px;
  background: var(--blue);
}

.monitor-row {
  top: 72px;
  height: 24px;
  width: 58%;
  background: var(--green);
}

.monitor-row.short {
  top: 112px;
  width: 45%;
  background: var(--desk);
}

.monitor-alert {
  width: 54px;
  height: 54px;
  left: auto;
  top: 72px;
  background: var(--red);
  border-radius: 50%;
}

.desk-item {
  position: absolute;
  border: var(--border);
  box-shadow: 4px 4px 0 var(--ink);
}

.phone-prop {
  width: 58px;
  height: 88px;
  left: 10%;
  bottom: 50px;
  border-radius: 12px;
  background: var(--pink);
  transform: rotate(-12deg);
}

.mug-prop {
  width: 74px;
  height: 62px;
  right: 9%;
  bottom: 64px;
  border-radius: 8px 8px 18px 18px;
  background: #fffdf7;
}

.mug-prop::after {
  content: "";
  width: 28px;
  height: 34px;
  position: absolute;
  right: -25px;
  top: 10px;
  border: 4px solid var(--ink);
  border-left: 0;
  border-radius: 0 16px 16px 0;
}

.desk-line {
  height: 88px;
  position: absolute;
  left: -14px;
  right: -14px;
  bottom: 0;
  border: var(--border);
  border-radius: 18px 18px 0 0;
  background: var(--desk);
  box-shadow: inset 0 -18px 0 var(--desk-dark);
}

.button {
  min-height: 58px;
  width: 100%;
  border: var(--border);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.04rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

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

.button:focus-visible,
.item-card:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 3px;
}

.primary-button {
  background: var(--green);
}

.secondary-button {
  background: #fffdf7;
}

.footer-line {
  min-height: 40px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.game-screen {
  justify-content: center;
  gap: 10px;
}

.game-header {
  min-height: 78px;
  flex: 0 0 auto;
}

.timer-box {
  width: 96px;
  flex: 0 0 96px;
  padding: 8px 6px;
  border: var(--border);
  border-radius: 8px;
  background: #fffdf7;
  text-align: center;
  box-shadow: 4px 4px 0 var(--ink);
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.timer-box.is-warning {
  background: var(--desk);
}

.timer-box.is-urgent {
  background: var(--red);
  color: #fffdf7;
  transform: rotate(-2deg) scale(1.06);
  box-shadow: 6px 6px 0 var(--ink);
  animation: urgentPulse 420ms ease-in-out infinite alternate;
}

.timer-box span {
  display: block;
  font-size: 2.1rem;
  font-weight: 950;
  line-height: 0.9;
}

.timer-box small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.timer-box.is-urgent small {
  color: #fffdf7;
}

.instruction {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 850;
}

.office-scene {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  border: var(--border);
  border-radius: 10px;
  background:
    linear-gradient(180deg, #9fd3e6 0 23%, transparent 23%),
    #f4d99f;
  box-shadow: 7px 7px 0 var(--ink);
  overflow: hidden;
}

.scene-top {
  height: clamp(70px, 16%, 92px);
  min-height: 70px;
  flex: 0 0 auto;
  position: relative;
}

.window-shape {
  width: 42%;
  height: 68%;
  position: absolute;
  left: 20px;
  top: 18px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 47%, var(--ink) 47% 53%, transparent 53%),
    linear-gradient(180deg, transparent 47%, var(--ink) 47% 53%, transparent 53%),
    #d8f4ff;
}

.boss-shadow {
  width: 80px;
  height: 104px;
  position: absolute;
  right: 22px;
  top: 18px;
  border: 4px solid var(--ink);
  border-radius: 36px 36px 10px 10px;
  background: #39342f;
  transform: translateX(22px);
  transition: transform 200ms linear;
}

.boss-shadow::before {
  content: "";
  width: 46px;
  height: 38px;
  position: absolute;
  left: 13px;
  top: -24px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #f1b982;
}

.item-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 12px;
  padding: 4px 14px 70px;
  z-index: 1;
}

.item-card {
  min-height: 86px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 22px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 130ms ease, box-shadow 130ms ease, opacity 130ms ease, background 130ms ease;
}

.item-card:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.item-card.is-hidden-item {
  opacity: 0.72;
  transform: translateY(8px) scale(0.96);
  background: #d9f5df;
  box-shadow: none;
}

.item-card.is-hidden-item::after {
  content: "";
}

.item-card.is-safe-mistake {
  background: #ffd9d4;
  animation: mistakeShake 260ms ease-in-out 2;
}

.item-card.is-safe-mistake::after {
  content: "";
}

.item-feedback {
  min-height: 20px;
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  padding: 2px 7px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fffdf7;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.item-card.is-hidden-item .item-feedback {
  background: var(--green);
  opacity: 1;
  transform: translateY(0);
}

.item-card.is-safe-mistake .item-feedback {
  background: var(--red);
  color: #fffdf7;
  opacity: 1;
  transform: translateY(0);
}

.item-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--icon-bg, var(--blue));
  font-size: 1.45rem;
  line-height: 1;
}

.item-icon::before {
  display: none;
}

.item-card[data-kind="chat"] .item-icon::before,
.item-card[data-kind="notes"] .item-icon::before {
  width: 21px;
  height: 15px;
  border-radius: 8px 8px 8px 2px;
}

.item-card[data-kind="phone"] .item-icon::before {
  width: 13px;
  height: 22px;
  border-radius: 5px;
}

.item-card[data-kind="food"] .item-icon::before {
  width: 22px;
  height: 13px;
  border-radius: 50%;
}

.item-card[data-kind="work"] .item-icon::before,
.item-card[data-kind="code"] .item-icon::before {
  width: 22px;
  height: 17px;
}

.item-card[data-kind="money"] .item-icon::before {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.item-text {
  min-width: 0;
}

.item-label {
  display: block;
  font-size: clamp(1.02rem, 4.6vw, 1.18rem);
  font-weight: 950;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.item-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.desk-edge {
  height: 60px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 4px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(22, 18, 13, 0.16) 1px, transparent 1px),
    var(--desk);
  background-size: 24px 24px;
  box-shadow: inset 0 -18px 0 var(--desk-dark);
}

.status-row {
  min-height: 38px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 950;
}

.is-dense-level .game-header {
  min-height: 70px;
}

.is-dense-level .instruction {
  font-size: 0.92rem;
}

.is-dense-level .office-scene {
  min-height: 0;
}

.is-dense-level .scene-top {
  height: 66px;
  min-height: 66px;
}

.is-dense-level .item-grid {
  align-content: start;
  gap: 8px;
  padding: 2px 12px 60px;
}

.is-dense-level .item-card {
  min-height: 68px;
  gap: 8px;
  padding: 8px 8px 18px;
}

.is-dense-level .item-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  font-size: 1.18rem;
}

.is-dense-level .item-label {
  font-size: clamp(0.9rem, 3.8vw, 1.05rem);
}

.is-dense-level .item-note {
  margin-top: 3px;
  font-size: 0.62rem;
}

.is-dense-level .item-feedback {
  min-height: 17px;
  bottom: 4px;
  border-width: 2px;
  font-size: 0.58rem;
}

.is-dense-level .desk-edge {
  height: 52px;
  box-shadow: inset 0 -14px 0 var(--desk-dark);
}

.is-final-level .scene-top {
  height: 56px;
  min-height: 56px;
}

.is-final-level .window-shape {
  height: 58%;
  top: 12px;
}

.is-final-level .boss-shadow {
  width: 62px;
  height: 82px;
  top: 12px;
}

.is-final-level .boss-shadow::before {
  width: 36px;
  height: 30px;
  left: 9px;
  top: -20px;
}

.is-final-level .item-grid {
  gap: 7px;
  padding: 2px 10px 54px;
}

.is-final-level .item-card {
  min-height: 62px;
  padding: 7px 7px 17px;
}

.check-screen,
.result-screen {
  justify-content: center;
}

.boss-card,
.result-wrap {
  width: 100%;
  text-align: center;
}

.boss-face {
  width: 174px;
  height: 174px;
  position: relative;
  margin: 0 auto 24px;
  border: var(--border);
  border-radius: 50% 50% 42% 42%;
  background: #f1b982;
  box-shadow: 7px 7px 0 var(--ink);
}

.boss-face::before,
.boss-face::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  top: 66px;
  border-radius: 50%;
  background: var(--ink);
}

.boss-face::before {
  left: 48px;
}

.boss-face::after {
  right: 48px;
}

.boss-face span {
  width: 70px;
  height: 28px;
  position: absolute;
  left: calc(50% - 35px);
  bottom: 42px;
  border: 4px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 999px 999px;
}

#checkCopy {
  min-height: 54px;
  margin: 16px auto 22px;
  max-width: 23rem;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.result-copy {
  min-height: 82px;
  margin: 16px auto 20px;
  max-width: 24rem;
  color: var(--muted);
  font-size: 1.07rem;
  font-weight: 800;
  line-height: 1.35;
}

.result-stats {
  margin: 0 0 20px;
}

.result-stats div {
  flex: 1;
  min-height: 100px;
  display: grid;
  align-content: center;
  border: var(--border);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 4px 4px 0 var(--ink);
}

dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

dd {
  margin: 5px 0 0;
  font-size: 2.05rem;
  font-weight: 950;
  line-height: 1;
}

@keyframes mistakeShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px) rotate(-1deg);
  }

  75% {
    transform: translateX(5px) rotate(1deg);
  }
}

@keyframes urgentPulse {
  from {
    filter: saturate(1);
  }

  to {
    filter: saturate(1.4) brightness(1.05);
  }
}

.result-actions {
  display: grid;
  gap: 12px;
}

.share-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

@media (min-width: 720px) {
  .screen {
    width: min(430px, calc((100svh - 20px) * 0.59));
    height: min(790px, calc(100svh - 20px));
    min-height: 640px;
  }

  .app {
    padding: 10px;
  }

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

@media (min-width: 720px) and (max-height: 760px) {
  .title-stack {
    margin: 16px 0 12px;
  }

  h1 {
    font-size: clamp(3.6rem, 8svh, 4.7rem);
  }

  .tagline {
    font-size: 1.05rem;
  }

  .hero-desk {
    flex-basis: clamp(176px, 30svh, 220px);
    margin-bottom: 14px;
  }

  .footer-line {
    min-height: 32px;
    margin-top: 10px;
  }
}

@media (max-height: 720px) {
  .screen {
    width: min(100%, 420px, calc((100svh - 12px) * 0.62));
    height: calc(100svh - 12px);
    min-height: 0;
  }

  .title-stack {
    margin: 16px 0 12px;
  }

  h1 {
    font-size: clamp(3.2rem, 16vw, 5rem);
  }

  .hero-desk {
    flex-basis: clamp(172px, 31svh, 220px);
    margin-bottom: 16px;
  }

  .game-screen {
    gap: 8px;
  }

  .game-header {
    min-height: 68px;
  }

  .timer-box {
    width: 88px;
    flex-basis: 88px;
  }

  .timer-box span {
    font-size: 1.85rem;
  }

  .instruction {
    font-size: 0.92rem;
  }

  .office-scene {
    min-height: 0;
  }

  .item-card {
    min-height: 74px;
    padding-bottom: 20px;
  }

  .is-dense-level .scene-top {
    height: 54px;
    min-height: 54px;
  }

  .is-dense-level .item-grid {
    gap: 6px;
    padding: 0 9px 48px;
  }

  .is-dense-level .item-card {
    min-height: 56px;
    padding: 6px 6px 15px;
  }

  .is-dense-level .item-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 1rem;
  }

  .is-dense-level .item-label {
    font-size: 0.86rem;
  }

  .is-dense-level .desk-edge {
    height: 46px;
  }

  .status-row {
    font-size: 0.88rem;
  }
}
