/* no need to look here?????? */

:root {
  --bg: #ffffff;
  --panel: #111111;
  --sand: #e9c97f;
  --sandDark: #b8924a;
  --ink: #4a3a1a;
  --text: #111111;
  --green: #2e9e4a;
  --good: #2e9e4a;
  --bad: #d6392f;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Fredoka", "Trebuchet MS", "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 16px 24px;
}

#topBar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--bg); z-index: 5; }
#streak { font-size: 1.1rem; font-weight: bold; }
#streak.hidden { visibility: hidden; }
#settingsBtn { background: #000; color: #fff; border: 2px solid #000; border-radius: 8px; padding: 8px 14px; font-size: 1rem; cursor: pointer; }
#settingsBtn:hover { background: #333; }

#cards { display: flex; flex-direction: column; gap: 10px; width: min(90vw, 460px); }
.card {
  min-height: 200px;
  background: var(--sand);
  border: 6px solid var(--sandDark);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--ink);
  text-align: center;
  font-size: 1.7rem;
  line-height: 1.35;
}
.card.word { font-size: 1.1rem; }
.card img { max-width: 100%; max-height: 300px; display: block; }
#cards.four .card { min-height: 78px; padding: 8px 14px; font-size: 1.3rem; border-width: 4px; border-radius: 14px; }
#cards.four .card.word { font-size: 0.8rem; line-height: 1.25; }
#cards.four .card img { max-height: 110px; }

#wait.good { color: var(--good); }
#wait.bad { color: var(--bad); }
#wait { height: 1.5em; font-size: 1.15rem; font-weight: bold; color: var(--text); margin-bottom: 4px; }
#answerRow { display: flex; gap: 10px; align-items: center; }
#answer { width: 130px; font-size: 2rem; text-align: center; letter-spacing: 4px; padding: 8px; border-radius: 10px; border: 3px solid var(--sandDark); background: #fff; color: var(--text); }
#submitBtn { font-size: 1.1rem; padding: 14px 20px; border-radius: 10px; border: none; background: var(--green); color: #fff; font-weight: bold; cursor: pointer; }
#submitBtn:hover:not(:disabled) { background: #268a3e; }
#answer:disabled, #submitBtn:disabled, #keypad button:disabled { opacity: 0.5; }

#keypad { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 68px); gap: 8px; }
#keypad button { height: 56px; font-size: 1.4rem; font-weight: bold; border-radius: 10px; border: 2px solid #000; background: #000; color: #fff; cursor: pointer; }
#keypad button:active { background: #444; }

#overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 10; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; }
#overlay.open { opacity: 1; visibility: visible; }
#modal { background: #fff; color: var(--text); border: 3px solid var(--sandDark); border-radius: 14px; padding: 22px; width: min(92vw, 340px); }
#modal h2 { margin: 0 0 14px; }
.setting { margin-bottom: 18px; }
.setting label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: bold; }
.setting input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--sandDark); }
.note { font-size: 0.8rem; opacity: 0.7; margin-top: 6px; }
#saveBtn { width: 100%; padding: 12px; font-size: 1.5rem; border: none; border-radius: 10px; background: var(--sand); color: var(--ink); font-weight: bold; cursor: pointer; }

#settingsBtn, #submitBtn, #keypad button, #saveBtn {
  border: 2px solid #9a9a9a;
  border-radius: 12px;
  box-shadow: 0 5px 0 #9a9a9a, 0 8px 10px rgba(0, 0, 0, 0.18);
  transform: translateY(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.15s;
}
#settingsBtn:active:not(:disabled), #submitBtn:active:not(:disabled), #keypad button:active:not(:disabled), #saveBtn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #9a9a9a, 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.05s, box-shadow 0.05s, background 0.05s;
}
#settingsBtn:disabled, #submitBtn:disabled, #keypad button:disabled {
  box-shadow: 0 5px 0 #c4c4c4;
  border-color: #c4c4c4;
}
#keypad { gap: 12px; margin-bottom: 8px; }
#answerRow { margin-bottom: 6px; }

.card { box-shadow: 0 4px 0 #bdbdbd, 0 8px 12px rgba(0, 0, 0, 0.12); }
#cards { gap: 14px; }
#answer { box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.15); }

#settingsBtn { padding: 8px; display: flex; align-items: center; justify-content: center; }
#settingsBtn img { width: 30px; height: 30px; display: block; object-fit: contain; }

#settingsBtn, #submitBtn, #keypad button, #saveBtn { background: #fff; color: #111; }
#settingsBtn:hover, #submitBtn:hover:not(:disabled), #keypad button:hover:not(:disabled), #saveBtn:hover { background: #f0f0f0; }
#settingsBtn:active:not(:disabled), #submitBtn:active:not(:disabled), #keypad button:active:not(:disabled), #saveBtn:active:not(:disabled) { background: #e4e4e4; }

html, body { overflow-x: hidden; }
.card { position: relative; }
.card.correct { border-color: #2e9e4a; background: #dff5e3; box-shadow: 0 4px 0 #1f7a37, 0 0 20px rgba(46, 158, 74, 0.6); animation: pop 0.4s ease-out; }
.card.wrong { border-color: #d6392f; background: #fbe0de; box-shadow: 0 4px 0 #a52a22, 0 0 20px rgba(214, 57, 47, 0.5); animation: shake 0.5s; }
.card.wrong::after { content: attr(data-answer); position: absolute; top: 6px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: #d6392f; color: #fff; font-size: 1.15rem; font-weight: bold; line-height: 32px; }
#cards.slideOut .card { animation: slideOut 0.38s cubic-bezier(0.64, 0, 0.78, 0) both; animation-delay: calc(var(--i, 0) * 70ms); }
#cards.slideIn .card { animation: slideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-12px); } 30% { transform: translateX(12px); } 45% { transform: translateX(-9px); } 60% { transform: translateX(9px); } 75% { transform: translateX(-4px); } 90% { transform: translateX(4px); } }
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes slideOut { to { transform: translateX(-140px) scale(0.96); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(140px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .card.correct, .card.wrong, #bigMark.show, #bigMark.slideOut, .revealMark, .revealDigit, .revealFill, #cards.slideOut .card, #cards.slideIn .card, #streak.bump, #answer.tick { animation: none; }
  #overlay, #modal { transition: none; }
}

.card { will-change: transform; transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
#modal { transform: translateY(24px) scale(0.94); transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
#overlay.open #modal { transform: none; }
#streak { transform-origin: center; }
#streak.bump { animation: bump 1.1s linear; }
#answer.tick { animation: tick 0.18s ease-out; }
@keyframes bump {
  0% { transform: scale(1) rotate(0deg); animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1); }
  18% { transform: scale(1.4) rotate(15deg); animation-timing-function: linear(0, 0.272, 0.646, 1, 1.25, 1.364, 1.354, 1.257, 1.125, 1, 0.912, 0.871, 0.875, 0.909, 0.956, 1, 1.031, 1.046, 1.044, 1.032, 1.016, 1, 0.989, 0.984, 0.984, 0.989, 0.994, 1, 1.004, 1.006, 1.006, 1.004, 1.002, 1, 0.999, 0.998, 0.998, 0.999, 0.999, 1, 1); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes tick { 0% { transform: scale(1); } 50% { transform: scale(1.07); } 100% { transform: scale(1); } }

#stage { position: relative; width: min(90vw, 460px); }
#cards { width: 100%; }
#markLayer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 3; }
#bigMark { display: none; width: 120px; height: 120px; border-radius: 50%; background: var(--good); color: #fff; font-size: 4.6rem; line-height: 120px; text-align: center; font-weight: bold; box-shadow: 0 6px 0 #1f7a37, 0 0 34px rgba(46, 158, 74, 0.65); }
#bigMark.show { display: block; animation: bigPop 1.5s linear(0, 0.15, 0.361, 0.599, 0.832, 1.038, 1.2, 1.309, 1.364, 1.37, 1.336, 1.272, 1.193, 1.108, 1.029, 0.962, 0.912, 0.881, 0.868, 0.873, 0.889, 0.914, 0.944, 0.973, 1, 1.021, 1.036, 1.045, 1.047, 1.043, 1.036, 1.026, 1.016, 1.005, 0.997, 0.99, 0.986, 0.984, 0.984, 0.986, 0.989, 0.992, 0.996, 0.999, 1.002, 1.004, 1.005, 1.006, 1.006, 1.005, 1.004, 1.002, 1.001, 1, 0.999, 0.998, 0.998, 0.998, 0.998, 0.998, 0.999, 0.999, 1, 1, 1) both; }
#bigMark.slideOut { animation: slideOut 0.38s cubic-bezier(0.64, 0, 0.78, 0) both; }
#bigMark.img, .revealMark.img { background: transparent; box-shadow: none; }
#bigMark img, .revealMark img { width: 100%; height: 100%; object-fit: contain; display: block; }
@keyframes bigPop { from { transform: rotate(-120deg) scale(0.75); } to { transform: rotate(0deg) scale(1); } }

#feedback { position: relative; width: min(90vw, 460px); height: 104px; display: flex; align-items: center; justify-content: center; }
#wait { height: auto; margin: 0; }
#reveal { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
#reveal.show { display: flex; }
#reveal.hide { opacity: 0; transition: opacity 0.3s ease; }
.revealLabel { font-size: 0.85rem; font-weight: bold; color: var(--bad); text-transform: uppercase; letter-spacing: 0.06em; }
.revealRow { display: flex; align-items: center; gap: 10px; }
.revealMark { width: 46px; height: 46px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 1.7rem; line-height: 46px; text-align: center; font-weight: bold; box-shadow: 0 3px 0 #a52a22; animation: badgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.revealDigit { width: 42px; height: 50px; border-radius: 10px; background: #fff; border: 3px solid var(--good); color: var(--text); font-size: 1.9rem; font-weight: bold; line-height: 44px; text-align: center; box-shadow: 0 4px 0 #1f7a37; animation: digitIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--d, 0) * 90ms + 150ms); }
.revealBar { width: 220px; max-width: 80%; height: 6px; border-radius: 3px; background: #e3e3e3; overflow: hidden; }
.revealFill { height: 100%; width: 100%; background: var(--bad); transform-origin: left; animation: drain linear forwards; }
@keyframes digitIn { from { transform: translateY(-14px) scale(0.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drain { to { transform: scaleX(0); } }

:root { --keyEdge: #9a9a9a; }
#settingsBtn { border-color: #000; box-shadow: 0 5px 0 #000, 0 8px 10px rgba(0, 0, 0, 0.18); }
#keypad button { border-color: var(--keyEdge); box-shadow: 0 5px 0 var(--keyEdge), 0 8px 10px rgba(0, 0, 0, 0.18); }
#settingsBtn:active:not(:disabled) { box-shadow: 0 1px 0 #000, 0 2px 4px rgba(0, 0, 0, 0.18); }
#keypad button:active:not(:disabled) { box-shadow: 0 1px 0 var(--keyEdge), 0 2px 4px rgba(0, 0, 0, 0.18); }

button, input { font-family: inherit; }
.card { font-family: "Trebuchet MS", "Segoe UI", sans-serif; }

:root { --ui: #3a3a3a; --uiEdge: #101010; --stripes: repeating-linear-gradient(45deg, #404040 0 10px, #363636 10px 20px); }
html[data-theme="dark"] { --bg: #16181b; --text: #f1f1f1; }
html[data-theme="dark"] .revealBar { background: #3d4046; }
html[data-theme="dark"] .card:not(.correct):not(.wrong) { box-shadow: 0 4px 0 #000, 0 8px 16px rgba(0, 0, 0, 0.6); }

#settingsBtn, #submitBtn, #keypad button, #saveBtn, .tab, #answer, #streak, #modal, .revealDigit {
  background-color: var(--ui); background-image: var(--stripes);
  border: 4px solid var(--uiEdge); color: #fff;
}
#settingsBtn, #submitBtn, #keypad button, #saveBtn, .tab, #streak, h2 {
  text-shadow: -2px 0 #000, 2px 0 #000, 0 -2px #000, 0 2px #000, -2px -2px #000, 2px -2px #000, -2px 2px #000, 2px 2px #000;
}
#settingsBtn, #submitBtn, #keypad button, #saveBtn, .tab {
  border-radius: 16px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.1);
  transform: none; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s;
}
#settingsBtn:hover:not(:disabled), #submitBtn:hover:not(:disabled), #keypad button:hover:not(:disabled), #saveBtn:hover:not(:disabled), .tab:hover {
  background-color: var(--ui); background-image: var(--stripes); filter: brightness(0.75);
}
#settingsBtn:active:not(:disabled), #submitBtn:active:not(:disabled), #keypad button:active:not(:disabled), #saveBtn:active:not(:disabled), .tab:active {
  background-color: var(--ui); background-image: var(--stripes); transform: scale(0.94); filter: brightness(0.6);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.1); transition: transform 0.05s, filter 0.05s;
}
#settingsBtn:disabled, #submitBtn:disabled, #keypad button:disabled { border-color: var(--uiEdge); box-shadow: none; opacity: 0.5; }
#settingsBtn { width: 62px; height: 62px; padding: 6px; }
#settingsBtn img { width: 100%; height: 100%; }
#keypad button { height: 58px; font-size: 1.75rem; }
#submitBtn { color: #8dffa5; font-size: 1.375rem; }
#answer { border-radius: 14px; box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.45); }
#answer { font-family: "Fredoka", "Trebuchet MS", sans-serif; font-weight: 600; }
#answer::placeholder { color: #999; }
#streak { padding: 8px 16px; border-radius: 16px; }
#modal { border-radius: 22px; box-shadow: none; }
.revealDigit { border-color: var(--good); border-radius: 10px; }

#tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { flex: 1; padding: 8px; font-size: 1rem; font-weight: bold; cursor: pointer; opacity: 0.6; }
.tab.active { opacity: 1; box-shadow: inset 0 -5px 0 #8dffa5; }
.pane { display: none; }
.pane.active { display: block; }

#bigMark img, .revealMark img { animation: circlePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes circlePop { from { transform: scale(0); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #bigMark img, .revealMark img { animation: none; } }

.setting input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; margin: 0; cursor: pointer;
  width: 30px; height: 30px; border: 4px solid var(--uiEdge); border-radius: 9px;
  background-color: var(--ui); background-image: var(--stripes);
  transition: background-color 0.2s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s;
}
.setting input[type="checkbox"]:hover { filter: brightness(1.3); }
.setting input[type="checkbox"]:active { transform: scale(0.85); }
.setting input[type="checkbox"]:checked { background-color: #2e9e4a; background-image: none; }
.setting input[type="checkbox"]::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 6px; height: 12px;
  border: solid #fff; border-width: 0 4px 4px 0; border-radius: 1px;
  transform: rotate(45deg) scale(0); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.setting input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
@media (prefers-reduced-motion: reduce) { .setting input[type="checkbox"], .setting input[type="checkbox"]::after { transition: none; } }

#timer { display: none; position: relative; width: min(90vw, 460px); height: 24px; margin-bottom: 10px; border: 4px solid var(--uiEdge); border-radius: 12px; background-color: var(--ui); background-image: var(--stripes); overflow: hidden; }
#timer.on { display: block; }
#timerFill { height: 100%; width: 100%; background: #86e69a; transform-origin: left center; will-change: transform; }
#timerText { position: absolute; inset: 0; text-align: center; font-size: 0.8rem; line-height: 16px; font-weight: bold; color: #fff; text-shadow: -2px 0 #000, 2px 0 #000, 0 -2px #000, 0 2px #000, -2px -2px #000, 2px -2px #000, -2px 2px #000, 2px 2px #000; }
.timeRow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
#optTimeValue { width: 90px; font-family: inherit; font-size: 1.1rem; font-weight: 600; text-align: center; padding: 6px; border-radius: 10px; border: 4px solid var(--uiEdge); background-color: var(--ui); background-image: var(--stripes); color: #fff; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4); }
#optTimeValue:disabled { opacity: 0.45; }

.pane.leaving .setting { animation: settingOut 0.18s ease-in both; animation-delay: calc(var(--i, 0) * 70ms); }
.pane.entering .setting { animation: settingIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes settingOut { to { transform: scale(0.6); opacity: 0; } }
@keyframes settingIn { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pane.leaving .setting, .pane.entering .setting, #streak.bump { animation: none; } }

#overlay { flex-direction: column; gap: 14px; }
#modal { max-height: calc(100dvh - 80px); overflow-y: auto; }
#credit { color: #fff; font-size: 1rem; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); opacity: 0; transform: translateY(24px); transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s, opacity 0.3s ease 0.05s; }
#overlay.open #credit { opacity: 0.95; transform: none; }
#credit a { color: #8dffa5; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { #credit { transition: none; } }

:root {
  --btn: clamp(44px, 7dvh, 62px);
  --topH: calc(max(var(--btn), 52px) + 16px);
  --fbH: clamp(84px, 12dvh, 116px);
  --ansH: clamp(46px, 7.2dvh, 62px);
  --keyH: clamp(32px, 5.2dvh, 46px);
  --keyGap: clamp(5px, 1dvh, 9px);
}
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; }
body {
  height: 100dvh; min-height: 0; overflow-y: auto;
  justify-content: center; justify-content: safe center;
  padding: calc(var(--topH) + 14px) 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
body > * { flex-shrink: 0; }
#topBar { padding: 8px 14px; }
#settingsBtn { width: var(--btn); height: var(--btn); }

#stage { flex: 1 1 0; flex-shrink: 1; max-height: 180px; display: flex; flex-direction: column; }
body.imgMode #stage { max-height: 240px; }
body.four #stage { max-height: 400px; }
#cards { flex: 1 1 auto; gap: clamp(6px, 1.4dvh, 14px); }
#cards .card, #cards.four .card { flex: 1 1 0; min-height: auto; }
.card { padding: clamp(8px, 2dvh, 20px); font-size: clamp(1.15rem, 3.6dvh, 1.7rem); border-width: clamp(4px, 0.8dvh, 6px); }
.card.word { font-size: clamp(0.85rem, 2.4dvh, 1.1rem); }
body.imgMode .card { padding: 8px; }
#bigMark img { animation: none; }
#streak { display: flex; align-items: center; gap: 8px; }
#streak img { height: 1.5em; width: auto; display: block; }
.card img { max-height: min(200px, 22dvh); object-fit: contain; }
#cards.four .card { padding: 4px 10px; font-size: clamp(0.95rem, 2.6dvh, 1.3rem); border-width: 3px; }
#cards.four .card.word { font-size: clamp(0.62rem, 1.7dvh, 0.8rem); line-height: 1.15; }
#cards.four .card img { max-height: clamp(30px, 7dvh, 72px); }

#feedback { height: var(--fbH); }
#answerRow { margin-bottom: 4px; }
#answer { height: var(--ansH); padding: 0 8px; font-size: clamp(1.5rem, 4.4dvh, 2rem); }
#submitBtn { height: var(--ansH); padding: 0 20px; font-size: clamp(1.1rem, 3dvh, 1.375rem); }
#keypad { grid-template-columns: repeat(3, clamp(60px, 18vw, 76px)); gap: var(--keyGap); margin: clamp(6px, 1.4dvh, 14px) 0 6px; }
#keypad button { height: var(--keyH); font-size: clamp(1.3rem, 3.6dvh, 1.75rem); }

@media (max-height: 760px) {
  .revealMark { width: 34px; height: 34px; line-height: 34px; font-size: 1.3rem; }
  .revealDigit { width: 34px; height: 40px; line-height: 34px; font-size: 1.5rem; border-width: 3px; }
  #reveal { gap: 3px; }
  .revealLabel { font-size: 0.72rem; }
  #wait { font-size: 1rem; }
}

#feedback { height: 0; overflow: hidden; transition: height 0.45s cubic-bezier(0.25, 1, 0.5, 1); }
body.answered #feedback { height: var(--fbH); }
#reveal { inset: 0 0 auto 0; height: var(--fbH); padding: 8px 0 6px; gap: 6px; }
#keypad button { height: calc(var(--keyH) + var(--fbH) / 4); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s, height 0.45s cubic-bezier(0.25, 1, 0.5, 1); }
body.answered #keypad button { height: var(--keyH); }
#keypad button:active:not(:disabled) { transition: transform 0.05s, filter 0.05s, height 0.45s cubic-bezier(0.25, 1, 0.5, 1); }
.revealLabel.good { color: var(--good); }
.revealMark.good:not(.img) { background: var(--good); box-shadow: 0 3px 0 #1f7a37; }
.revealFill.good { background: var(--good); }
@media (prefers-reduced-motion: reduce) { #feedback, #keypad button { transition: none; } }

:root {
  --kr: 1.2;
  --keyW: clamp(50px, 14vw, 62px);
  --keyFont: clamp(1.1rem, 3dvh, 1.45rem);
  --fbH: clamp(84px, 12dvh, 116px);
  --fbIdle: calc(var(--fbH) - (var(--kr) - 1) * (4 * var(--keyH) + 3 * var(--keyGap)));
  --keyEase: cubic-bezier(0.25, 1, 0.5, 1);
}
#keypad { grid-template-columns: repeat(3, calc(var(--keyW) * var(--kr))); gap: calc(var(--keyGap) * var(--kr)); transition: grid-template-columns 0.45s var(--keyEase), gap 0.45s var(--keyEase); }
#keypad button { height: calc(var(--keyH) * var(--kr)); font-size: calc(var(--keyFont) * var(--kr)); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s, height 0.45s var(--keyEase), font-size 0.45s var(--keyEase); }
#feedback { height: var(--fbIdle); }
body.answered #keypad { grid-template-columns: repeat(3, var(--keyW)); gap: var(--keyGap); }
body.answered #keypad button { height: var(--keyH); font-size: var(--keyFont); }
#keypad button:active:not(:disabled) { transition: transform 0.05s, filter 0.05s, height 0.45s var(--keyEase), font-size 0.45s var(--keyEase); }
@media (prefers-reduced-motion: reduce) { #keypad, #keypad button { transition: none; } }
body.four { --keyH: clamp(30px, 4.6dvh, 40px); --keyW: clamp(46px, 12.5vw, 56px); --keyGap: clamp(4px, 0.8dvh, 7px); --keyFont: clamp(1rem, 2.6dvh, 1.3rem); --fbIdle: calc(var(--fbH) - (var(--kr) - 1) * (4 * var(--keyH) + 3 * var(--keyGap))); }
body.four #stage { max-height: 560px; }
#cards.four .card.imgCard { min-height: 48px; padding: 0; }
#cards.four .card.imgCard img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); max-height: none; object-fit: contain; }
body.four { --kr: 1.5; padding-top: calc(var(--topH) + 6px); }

.card img { pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.card { -webkit-touch-callout: none; }

#topLeft { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
#siteUrl { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1.1rem; font-weight: 600; white-space: nowrap; text-align: left; color: #fff; -webkit-text-stroke: 0.34em #000; paint-order: stroke fill; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#siteUrl:hover { filter: brightness(0.8); }
#siteUrl:active { filter: brightness(0.6); }
@media (max-width: 600px) {
  :root { --topH: calc(max(var(--btn), 72px) + 16px); }
  #siteUrl { position: static; transform: none; font-size: 0.85rem; }
}