/* Base from Play with Penny (tiny-play css/style.css): tokens, top bar, Penny, grown-up check. */
/* Hand-inked look borrowed from the ICAS Penny set: thick ink outlines, flat fills, hard offset shadows. */
:root {
  --ink: #1A1A1A;
  --yellow: #FFDD00;
  --yellow-pale: #FFF3A6;
  --cream: #F2EEDA;
  --paper: #FFFDF4;
  --teal: #DFF1F2;
  --lav: #DBCFFA;
  --green: #CEF7C7;
  --blush: #FFB3A7;
  --line: 0.7vmin;
  --shadow: 0 1.1vmin 0 var(--ink);
  --wobble: 3.2vmin 2.4vmin 3.6vmin 2.2vmin / 2.4vmin 3.4vmin 2.2vmin 3.2vmin;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic Pro", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-weight: 700;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: none;
}

svg { display: block; width: 100%; height: 100%; overflow: visible; }

#app { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }

.screen {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.leaving { display: none !important; }
.bg-cream { background: var(--cream); }
.bg-lav { background: var(--lav); }
.bg-teal { background: var(--teal); }

/* paper dots texture */
.screen::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(26, 26, 26, .08) 0.25vmin, transparent 0.3vmin);
  background-size: 4vmin 4vmin;
  pointer-events: none;
}

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center;
  height: 15vmin; padding: 2.5vmin 3.5vmin 0;
  flex: 0 0 auto;
}
.spacer { flex: 1; }
.round-btn {
  width: 12vmin; height: 12vmin; padding: 2vmin;
  border-radius: 50%;
  background: #fff; border: var(--line) solid var(--ink); box-shadow: var(--shadow);
}
.round-btn:active { transform: translateY(0.8vmin); box-shadow: 0 0.3vmin 0 var(--ink); }
.mute-btn { margin-right: 2.5vmin; padding: 2.2vmin; }
.mute-btn .cross { display: none; }
.mute-btn.off .cross { display: inline; }
.mute-btn.off .wave { display: none; }
.top-slot { display: flex; align-items: center; }
.starbox {
  display: flex; align-items: center;
  height: 11vmin; padding: 0 3vmin 0 1.4vmin;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 6vmin; box-shadow: var(--shadow);
  font-size: 6.5vmin; font-weight: 900;
}
.starbox svg { width: 8vmin; height: 8vmin; margin-right: 1.2vmin; }
.starbox.pulse { animation: pulse .5s ease; }

/* ---------- Penny ---------- */
.penny { position: relative; z-index: 1; }
.penny-inner { width: 100%; height: 100%; transform-origin: 50% 95%; animation: sway 3.2s ease-in-out infinite; }
.penny-svg { width: 100%; height: 100%; }
.penny-eyes { transform-origin: 150px 262px; animation: blink 4.6s infinite; }
.penny.hop { animation: hop .26s ease-out; }
.penny.jump { animation: jump .7s cubic-bezier(.3, 1.6, .5, 1) 2; }
.penny.shake { animation: shake .5s ease; }
@keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-2.4vmin); } 100% { transform: translateY(0); } }
@keyframes jump { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-6vmin) scale(1.05); } }
@keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-1.2vmin); } }
@keyframes glow { from { transform: scale(.85); } to { transform: scale(1.15); } }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes yay { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-6deg); } 100% { transform: scale(1); } }
.st-open { padding: 2vmin; }
.st-open svg { width: 100%; height: 100%; }
.st-open { position: relative; overflow: visible; }
.st-left {
  position: absolute; left: 50%; bottom: -2.2vmin; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  padding: 0.2vmin 1.2vmin; border: 0.35vmin solid var(--ink); border-radius: 99px; background: #fffdf5;
  font: 900 2.2vmin 'Zen Kaku Gothic New', sans-serif; color: var(--ink);
}
.st-left.low { background: #FFB3A8; }
.st-choice.warn { background: #FFE0DC; }
.st-choice.warn.on { background: #FF8A7E; }
.st-cover {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: inherit; color: var(--ink); touch-action: none;
}
.st-break { background: linear-gradient(#1D2B5A, #3A4F8F); color: #fff; }
.st-gate { background: rgba(26, 26, 26, .55); }
.st-moon { width: 18vmin; height: 18vmin; animation: bob 2s ease-in-out infinite alternate; }
.st-moon svg { width: 100%; height: 100%; }
.st-penny { width: 30vmin; height: 27vmin; }
.st-title { font-size: 9vmin; font-weight: 900; margin: 2vmin 0 1vmin; -webkit-text-stroke: 0.2vmin var(--ink); color: #FFDD00; text-align: center; }
.st-title.small { font-size: 6vmin; color: var(--ink); -webkit-text-stroke: 0; }
.st-sub { font-size: 4.2vmin; font-weight: 700; text-align: center; margin-bottom: 2vmin; }
.st-lock {
  position: absolute; right: 3vmin; bottom: 3vmin; display: flex; align-items: center; padding: 1.2vmin 2.4vmin;
  font-size: 3.4vmin; font-weight: 900; background: rgba(255, 255, 255, .15); color: #fff; border: 0.4vmin solid rgba(255, 255, 255, .5); border-radius: 4vmin;
}
.st-lock svg { width: 6vmin; height: 6vmin; margin-right: 1.2vmin; }
.st-card {
  width: 60vmin; max-width: 92vw; padding: 3vmin; background: var(--paper); color: var(--ink); text-align: center;
  border: var(--line) solid var(--ink); border-radius: var(--wobble); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center;
}
.st-card.wide { width: 96vmin; max-height: 96vh; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 2vmin 3vmin; }
.st-card.wide .st-title.small { margin: 0 0 0.6vmin; font-size: 5vmin; }
.st-card.wide .st-sub { margin-bottom: 1vmin; font-size: 3.6vmin; }
.st-card.wide .st-label { margin: 0.4vmin 0; font-size: 3.4vmin; }
.st-card.wide .st-choices { margin-bottom: 0.8vmin; }
.st-card.wide .st-choice { margin: 0.6vmin; padding: 1vmin 1.8vmin; font-size: 3.2vmin; }
.st-card.wide .st-done { height: 8vmin; flex: none; }
.st-typed { width: 30vmin; padding: 1vmin; margin-bottom: 2vmin; font-size: 7vmin; font-weight: 900; background: #fff; border: 0.5vmin solid var(--ink); border-radius: 2vmin; }
.st-typed.wobble { animation: wobble .45s ease; }
.st-pad { display: grid; grid-template-columns: repeat(3, 13vmin); grid-gap: 1.4vmin; }
.st-key { height: 10vmin; font-size: 5vmin; font-weight: 900; background: #fff; border: 0.5vmin solid var(--ink); border-radius: 2vmin; box-shadow: 0 0.6vmin 0 var(--ink); }
.st-key.ok { background: #3CC77A; color: #fff; }
.st-key:active, .st-choice:active { transform: translateY(0.5vmin); box-shadow: 0 0.1vmin 0 var(--ink); }
.st-link { margin-top: 2vmin; font-size: 4vmin; font-weight: 700; background: none; border: 0; text-decoration: underline; color: var(--ink); }
.st-label { font-size: 4vmin; font-weight: 900; margin: 1vmin 0; }
.st-choices { display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 2vmin; }
.st-choice {
  margin: 0.8vmin; padding: 1.4vmin 2.4vmin; font-size: 3.8vmin; font-weight: 900;
  background: #fff; border: 0.5vmin solid var(--ink); border-radius: 3vmin; box-shadow: 0 0.6vmin 0 var(--ink);
}
.st-choice.on { background: var(--yellow); }
.st-done { width: 30vmin; }

