﻿:root {
  --ink: #121212;
  --shell-pad-top: 14px;
  --shell-pad-x: 12px;
  --shell-pad-bottom: 6px;
  --shell-gap: 10px;
  --intro-bg-taupe: #fefcf6;
  --shell-bg-taupe: #fffefa;
  --tool-bg-taupe: #e3dccb;
  --intro-bg: #e0e0e0;
  --shell-bg: #fff;
  --tool-bg: #d4d4d4;
  --keyboard-offset: 0px;
  --keyboard-dock-height: 0px;
  --keyboard-back: #181818;
  --keyboard-key: #efefef;
  --keyboard-key-text: #10131a;
  --keyboard-font: "Roboto Local", Arial, Helvetica, sans-serif;
  --keyboard-enter: #83c5db;
  --keyboard-enter-text: #fff;
  --keyboard-backspace: #8c8c8c;
  --keyboard-backspace-text: #fff;
  --accent-reveal: #00e1ff;
  --uv-purple: #ca00d1;
  --snippet-button: #83c5db;
  --diff-0: white;
  --diff-1: #00d5ff;
  --diff-2: #33c711;
  --diff-3: #e99a06;
  --diff-4: #ff3c00;
  --snippet-hit: #bf0000;
  --message-duration: 3s;
  --snippet-burst-duration: 600ms;
  --tool-size: 80px;
  --tool-height: 45px;
  --uv-reveal-duration: 3s;
  --portrait-frame-ratio: 0.5625;
  --portrait-frame-cap-height: max(100dvh, 100vh);
  --portrait-frame-width: min(100vw, calc(var(--portrait-frame-cap-height) * var(--portrait-frame-ratio)));
  --portrait-frame-height: 100dvh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--shell-bg);
  color: var(--ink);
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-frame {
  position: relative;
  width: var(--portrait-frame-width);
  height: var(--portrait-frame-height);
  overflow: hidden;
  background: var(--shell-bg);
  touch-action: manipulation;
}

.orientation-block {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: #060608;
  color: #fff;
  text-align: center;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.orientation-block-panel {
  position: absolute;
  top: calc(var(--orientation-top, 0px) + (var(--orientation-height, 100vh) / 2));
  left: calc(var(--orientation-left, 0px) + (var(--orientation-width, 100vw) / 2));
  transform: translate(-50%, -50%);
  display: grid;
  gap: 10px;
  width: min(280px, calc(var(--orientation-width, 100vw) - 48px));
  max-width: calc(var(--orientation-width, 100vw) - 48px);
}

.orientation-block-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.orientation-block-copy {
  font-size: 1rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.intro-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 18vh;
  background: var(--intro-bg);
  overflow: hidden;
}

.intro-screen.hidden {
  display: none;
}

.intro-flag-button {
  position: absolute;
  bottom: 20px;
  right: 12px;
  z-index: 2;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
}

.intro-flag-button:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
  border-radius: 4px;
}

.intro-flag {
  width: 40px;
  height: 38px;
  display: block;
  filter: drop-shadow(1px 2px 2px grey);
}

.intro-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80%;
  max-width: 80%;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  font-size: clamp(1.5rem, calc(var(--portrait-frame-width) * 0.11), 4rem);
}

.intro-prefix {
  color: #000;
  opacity: 0;
  animation: intro-show-prefix 0.2s forwards;
  animation-delay: 1s;
  z-index: 3;
}

.intro-word-wrapper {
  position: relative;
  display: inline-block;
}

.intro-black-bar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 0;
  height: 100%;
  background: #000;
  animation: intro-cover-word 0.4s linear forwards;
  animation-delay: 0.4s;
}

.intro-word {
  position: relative;
  z-index: 2;
  color: #000;
  animation: intro-reveal-word 2s forwards;
  animation-delay: 1.2s;
}

.intro-actions {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translateX(-50%);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.play-button {
  width: 160px; height: 55px;
  border: 2px solid #000;
  border-radius: 20px;
  background: #fff;
  color: #000;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 5px grey;
}

.play-button.review-mode {
  background: none;
  color: #888;
}

.intro-utility-actions {
  position: absolute;
  left: 12px;
  bottom: 20px;
  z-index: 2;
  display: grid;
  justify-items: start;
  gap: 10px;
}

.intro-settings-button {
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 5px;
}

.intro-settings-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: brightness(0.7);
}

.share-button {
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #000;
  border-radius: 18px;
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 1px 2px grey;
  cursor: pointer;
  background: none;
}

.share-button-icon {
  width: 20px;
  height: 20px;
  display: block;
  filter: brightness(0);
}

.intro-stamp {
  display: grid;
  gap: 2px;
  margin-top: 15px;
  color: #555;
  text-align: center;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

#introStampStatus {
  margin-top: 5px;
  color: #7ab500;
}

#introStampStatus[hidden] {
  display: none;
}

#introStampDate {
  margin-top: 5px;
}

#introStreakStatus {
  margin-top: 20px;
}

#introStreakStatus[hidden] {
  display: none;
}

.app-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: var(--shell-bg);
  padding: var(--shell-pad-top) var(--shell-pad-x) var(--shell-pad-bottom);
  display: flex;
  flex-direction: column;
  gap: var(--shell-gap);
  overflow: hidden;
}

@media (orientation: landscape) and (pointer: coarse) {
  .orientation-block {
    display: block;
  }
}

.app-shell.prelaunch {
  display: none;
}

.app-shell.victory-pulse {
  animation: victory-pulse 1s ease;
}

.top-indicators {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  margin: calc(-1 * var(--shell-pad-top)) calc(-1 * var(--shell-pad-x)) 0;
  background: var(--tool-bg);
  z-index: 2;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
}

.indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 1px 2px;
  text-align: center;
}

.progress-indicator {
  display: grid;
  align-items: center;
  align-content: center;
  gap: 1px;
  min-height: 28px;
}

.percent-indicator {
  color: #222;
  white-space: nowrap;
}

.time-button {
  appearance: none;
  cursor: pointer;
  color: #555;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
}

.clearance-indicator {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-left: auto;
}

.clearance-label {
  display: block;
  text-align: right;
}

.clearance-value {
  display: block;
  font-size: 2.8rem;
  font-weight: 900;
  text-align: left;
  transform: translateY(0.00em);
  
}

.clearance-indicator.diff-0 .clearance-label,
.clearance-indicator.diff-0 .clearance-value {
  color: var(--diff-0, #ff2f2f);
}

.clearance-indicator.diff-1 .clearance-label,
.clearance-indicator.diff-1 .clearance-value {
  color: var(--diff-1);
}

.clearance-indicator.diff-2 .clearance-label,
.clearance-indicator.diff-2 .clearance-value {
  color: var(--diff-2);
}

.clearance-indicator.diff-3 .clearance-label,
.clearance-indicator.diff-3 .clearance-value {
  color: var(--diff-3);
}

.clearance-indicator.diff-4 .clearance-label,
.clearance-indicator.diff-4 .clearance-value {
  color: var(--diff-4);
}

.indicator.highlight {
  animation: indicator-highlight 0.45s ease;
}

.indicator.level-drop {
  animation: level-drop 0.5s ease;
}

.document-box {
  position: relative;
  min-height: 0;
  flex: 1;
  border: 0;
  background: var(--shell-bg);
  margin: calc(-1 * var(--shell-gap)) calc(-1 * var(--shell-pad-x));
  overflow: hidden;
}

.doc-viewport {
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}

.doc-viewport.layout-pending {
  opacity: 0;
  pointer-events: none;
}

.doc-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  transform-origin: 0 0;
  will-change: transform;
}

.doc-sheet {
  position: relative;
  width: 900px;
  height: 1600px;
  overflow: hidden;
  background: var(--shell-bg);
}

.doc-stamp {
  --doc-stamp-start-top: 50%;
  --doc-stamp-start-left: 50%;
  --doc-stamp-start-width: 70%;
  --doc-stamp-start-transform: translate(-50%,-50%) rotate(0deg);
  --doc-stamp-end-top: 75px;
  --doc-stamp-end-left: 60%;
  --doc-stamp-end-width: 32%;
  --doc-stamp-end-transform: translateX(0) rotate(18deg);
  --doc-stamp-intro-duration: 300ms;
  position: absolute;
  z-index: 3;
  top: var(--doc-stamp-end-top);
  left: var(--doc-stamp-end-left);
  width: var(--doc-stamp-end-width);
  max-width: none;
  opacity: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: var(--doc-stamp-end-transform);
  transform-origin: center center;
}

.doc-stamp.animate-intro {
  animation: doc-stamp-settle var(--doc-stamp-intro-duration) ease-in forwards;
}

@keyframes doc-stamp-settle {
  0% {
    top: var(--doc-stamp-start-top);
    left: var(--doc-stamp-start-left);
    width: var(--doc-stamp-start-width);
    transform: var(--doc-stamp-start-transform);
  }
  100% {
    top: var(--doc-stamp-end-top);
    left: var(--doc-stamp-end-left);
    width: var(--doc-stamp-end-width);
    transform: var(--doc-stamp-end-transform);
    opacity:0.8;
  }
}

.doc-texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.doc-sheet-flow {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.doc-header {
  display: block;
  width: 100%;
  height: auto;
  flex: 0 0 auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.doc-body {
  position: relative;
  z-index: 2;
  width: 82.5%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 14px auto 0;
  padding: 0 0 42px;
}

.doc-content {
  width: 100%;
  padding: 4px 3px;
  color: #000;
  background: transparent;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.28;
  white-space: pre-wrap;
}

.redacted-word {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  --letters: 4;
  z-index: 0;
}

.redacted-word.selected {
  z-index: 8;
}

.word-text {
  position: relative;
  z-index: 0;
  color: #000;
}

.redaction-bar {
  position: absolute;
  inset: 0.06em -0.07em;
  z-index: 1;
  border: 0;
  background: #000;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.redaction-bar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-reveal);
}

.redacted-word.selected[data-difficulty="1"] .redaction-bar {
  box-shadow: 0 0 0 2px var(--diff-1);
}

.redacted-word.selected[data-difficulty="2"] .redaction-bar {
  box-shadow: 0 0 0 2px var(--diff-2);
}

.redacted-word.selected[data-difficulty="3"] .redaction-bar {
  box-shadow: 0 0 0 2px var(--diff-3);
}

.redacted-word.selected[data-difficulty="4"] .redaction-bar {
  box-shadow: 0 0 0 2px var(--diff-4);
}

.redacted-word.solved .redaction-bar,
.redacted-word.solved .uv-letter-layer,
.redacted-word.solved .uv-slot-layer {
  display: none;
}

.redacted-word.solved .word-text {
  font-weight: 700;
}

.redacted-word.solved[data-difficulty="1"] .word-text {
  color: var(--diff-1);
}

.redacted-word.solved[data-difficulty="2"] .word-text {
  color: var(--diff-2);
}

.redacted-word.solved[data-difficulty="3"] .word-text {
  color: var(--diff-3);
}

.redacted-word.solved[data-difficulty="4"] .word-text {
  color: var(--diff-4);
}

.redacted-word.solved-pop {
  animation: solved-pop 0.95s cubic-bezier(0.2, 0.86, 0.3, 1.2);
}

.solve-burst {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 16;
  pointer-events: none;
  display: none;
}

.solve-burst.is-visible {
  display: block;
}

.solve-burst-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0.6em 1em;
  transform: translate(-50%, -50%);
  border: 4px solid black;
  border-radius: 40px;
  background: var(--snippet-button);
  color: #000;
  font-family: "Courier New", Courier, monospace;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 1);
  opacity: 0;
}

.solve-burst.is-visible .solve-burst-label {
  animation: found-pop var(--message-duration) ease forwards;
}
@keyframes found-pop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.5); }
  10% { opacity: 1; transform: translate(-50%, -108%) scale(1); }
  72% { opacity: 1; transform: translate(-50%, -128%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -250%) scale(0.5); }
}

.solve-burst-prefix {
  display: inline-block;
  color: #000;
  padding: 0.02em 0 0.02em 0.02em;
}

.solve-burst-word {
  display: inline-block;
  padding: 0.08em 0.22em;
  background: #000;
  color: #fff;
}

.level-drop-callout {
  position: absolute;
  top: 20px;
  right: 8px;
  z-index: 17;
  display: none;
  padding: 8px 18px;
  border: 3px solid white;
  border-radius: 18px;
  background: var(--snippet-hit);
  color: #fff;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 1);
  pointer-events: none;
}

.level-drop-callout::before {
  content: "";
  position: absolute;
  top: -16px;
  right: 24px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 16px solid white;
}

.level-drop-callout::after {
  content: "";
  position: absolute;
  top: -11px;
  right: 26px;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 13px solid var(--snippet-hit);
}

.level-drop-callout.is-visible {
  display: block;
  animation: level-drop-callout var(--message-duration) ease forwards;
}

.solve-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  opacity: 0;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
  animation: solve-particle-burst 1.2s cubic-bezier(0.16, 0.84, 0.27, 1) forwards;
}

.uv-letter-layer,
.uv-slot-layer,
.snippet-burst-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
}

.snippet-burst-layer {
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(var(--letters), minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  pointer-events: none;
  overflow: visible;
}

.redacted-word.has-revealed-letters .uv-letter-layer {
  display: grid;
  grid-template-columns: repeat(var(--letters), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  pointer-events: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  letter-spacing: inherit;
}

.redacted-word.editing .uv-letter-layer {
  column-gap: 0.08em;
}

.uv-letter-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  padding: 0;
  margin: 0;
  transition: color 180ms ease;
}

.uv-letter-cell.snippet-revealed {
  color: #fff;
}

.uv-letter-cell.snippet-revealed.snippet-recent {
  color: var(--snippet-button);
}

.uv-letter-cell.uv-revealed {
  color: var(--uv-purple);
}

.uv-letter-cell.placeholder,
.uv-letter-cell.typed-entry {
  color: #8f8f8f;
}

.uv-letter-cell.uv-revealing {
  animation: uv-letter-reveal var(--uv-reveal-duration) linear forwards;
}

.uv-slot-layer {
  z-index: 3;
  grid-template-columns: repeat(var(--letters), minmax(0, 1fr));
}

.redacted-word.uv-selecting .uv-slot-layer {
  display: grid;
}

.redacted-word.uv-animating .uv-slot-layer {
  display: grid;
  pointer-events: none;
}

.uv-reveal-mark {
  --uv-reveal-offset-y: -0.3em;
  display: block;
  place-self: center;
  width: 1.9em;
  height: 1.9em;
  background: center / contain no-repeat url("./assets/uv.png");
  animation: uv-reveal-mark var(--uv-reveal-duration) ease forwards;
  pointer-events: none;
}
@keyframes uv-reveal-mark {
  0% { transform: translateY(var(--uv-reveal-offset-y)) scale(0); }
  20% { transform: translateY(var(--uv-reveal-offset-y)) scale(1); }
  45% { transform: translateY(var(--uv-reveal-offset-y)) scale(0.8); }
  70% { transform: translateY(var(--uv-reveal-offset-y)) scale(1); }
  100% { transform: translateY(var(--uv-reveal-offset-y)) scale(0); }
}
@keyframes uv-letter-reveal {
  0% { opacity: 0; }
  20% { opacity: 0; }
  21% { opacity: 1; }
  100% { opacity: 1; }
}

.snippet-burst {
  display: block;
  --snippet-burst-size: 1em;
  --snippet-burst-petal-size: 6px;
  --snippet-burst-color: var(--snippet-button);
  place-self: center;
  width: calc(var(--snippet-burst-size) * 2.6);
  height: calc(var(--snippet-burst-size) * 2.6);
  position: relative;
  pointer-events: none;
  overflow: visible;
  transform: translate(0.15em, 0.15em);
}

.snippet-burst.solve-word-burst {
  --snippet-burst-size: 1.15em;
  --snippet-burst-petal-size: 7px;
}

.snippet-burst-petal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--snippet-burst-petal-size);
  height: var(--snippet-burst-petal-size);
  margin-left: calc(var(--snippet-burst-petal-size) * -0.5);
  margin-top: calc(var(--snippet-burst-petal-size) * -0.5);
  border-radius: 999px;
  background: var(--accent-reveal);
  opacity: 0;
  animation: snippet-burst-petal-flight var(--snippet-burst-duration) ease-out forwards;
  animation-delay: var(--snippet-burst-delay);
  pointer-events: none;
}

@keyframes snippet-burst-petal-flight {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--snippet-burst-angle)) translateY(0) scale(0.1);
  }
  90% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--snippet-burst-angle))
      translateY(calc(var(--snippet-burst-size) * -0.8)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--snippet-burst-angle))
      translateY(calc(var(--snippet-burst-size) * -1)) scale(0.5);
  }
}

.uv-slot {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8f8f8f;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.uv-slot:active {
  color: #b5b5b5;
}

.uv-slot:disabled,
.uv-slot.disabled {
  opacity: 0;
  cursor: not-allowed;
}

.difficulty-pill {
  width: fit-content;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.difficulty-pill.diff-1 {
  color: var(--diff-1);
}

.difficulty-pill.diff-2 {
  color: var(--diff-2);
}

.difficulty-pill.diff-3 {
  color: var(--diff-3);
}

.difficulty-pill.diff-4 {
  color: var(--diff-4);
}

.difficulty-meta {
  color: #8d8d8d;
  margin-left: 1em;
}

.tool-row {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--tool-bg);
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  gap: 20px;
  margin: 0 calc(-1 * var(--shell-pad-x)) calc(-1 * var(--shell-pad-bottom));
  padding: 15px 0px 15px;
  border-top: 1px solid grey;
  z-index: 3;
}

.game-home-button {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  touch-action: manipulation;
  pointer-events: auto;
  text-decoration: none;
  filter: brightness(0.66);
}

.game-home-icon {
  width: auto;
  height: 100%;
  display: block;
}

.tool-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 0;
  background: #920096;
  color: #eee;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 0;
  box-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.tool-hint.visible {
  opacity: 1;
}

.tool-hint.hidden {
  display: none;
}

.tool-tile {
  position: relative;
  display: flex;
  justify-content: center;
  min-width: 84px;
}

.review-results-button {
  min-width: 170px;
  height: 42px;
  padding: 0 18px;
  background: none;
  align-self: center;
  color:#888;
}

.review-results-button[hidden] {
  display: none;
}

.snippet-button {
  border: 2px solid grey;
  background: var(--snippet-button);
  color: #fff;
  min-width: var(--tool-size);
  height: var(--tool-height);
  min-height: var(--tool-height);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5em;
  font-weight: 700;
  border-radius: 16px;
  box-shadow: 1px 3px grey;
  position: relative;
}

.uv-button {
  border: 2px solid grey;
  width: var(--tool-size);
  height: var(--tool-height);
  border-radius: 16px;
  cursor: pointer;
  background: black;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-shadow: 1px 3px grey;
  position: relative;
  text-shadow: 0 0 2px var(--uv-purple), 0 0 3px var(--uv-purple), 0 0 6px var(--uv-purple), 0 0 10px var(--uv-purple), 0 0 15px var(--uv-purple), 0 0 20px var(--uv-purple);
}

.uv-button.armed {
  animation: none;
}

.snippet-button:disabled,
.snippet-button.disabled,
.uv-button:disabled,
.uv-button.used {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.45);
}

.tool-badge {
  position: absolute;
  top: -12px;
  right: -15px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #d1132d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.tool-badge.reward-hit {
  animation: tool-badge-hit 420ms cubic-bezier(0.22, 0.82, 0.34, 1.25);
}

.tool-badge-burst {
  position: absolute;
  top: 2px;
  right: -1px;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2;
}

.tool-badge-burst-petal {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  margin-top: -3.5px;
  border-radius: 999px;
  background: #d1132d;
  opacity: 0;
  animation: tool-badge-burst-flight 420ms ease-out forwards;
  transform: rotate(var(--tool-badge-burst-angle)) translateY(0) scale(0.1);
}

.tool-badge.empty {
  display: none;
}

.keyboard-hud {
  position: absolute;
  min-height:60px;
  left: 0;
  right: 0;
  bottom: var(--keyboard-dock-height);
  z-index: 18;
  padding: 8px 14px 8px;
  background: #181818;
  display: grid;
  gap: 6px;
  border-top: 2px solid grey;
}

.keyboard-hud.hidden {
  display: none;
}

.keyboard-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.keyboard-hud-top.hidden {
  display: none;
}

.keyboard-hud.word-mode .keyboard-hud-label,
.keyboard-hud.word-mode .keyboard-hud-display {
  display: none;
}

.keyboard-hud.snippet-mode {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.keyboard-hud.snippet-mode .keyboard-hud-label {
  text-align: left;
}

.keyboard-hud-label {
  color: #b2b2b2;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
}

.keyboard-awards {
  display: flex;
  align-items: center;
  gap: 10px;
}

.keyboard-award {
  position: relative;
  min-width: 40px;
  min-height: 28px;
  padding: 0;
  border: 2px solid #7b7b7b;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 1px 2px #8c8c8c;
}

.keyboard-award.snippet {
  background: var(--snippet-button);
}

.keyboard-award.uv {
  background: var(--uv-purple);
}

.keyboard-award.is-empty {
  opacity: 0.45;
  filter: saturate(0.35);
}

.keyboard-award-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #d1132d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.keyboard-award-badge.empty {
  display: none;
}

.reward-flight-badge {
  position: fixed;
  left: 0;
  top: 0;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #d1132d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  z-index: 40;
  will-change: transform, opacity;
}

.keyboard-hud-display {
  min-height: 48px;
  border: 2px solid #111;
  border-radius: 14px;
  background: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  font-family: "Roboto Local", Arial, Helvetica, sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.keyboard-hud.snippet-mode .keyboard-hud-display {
  width: 60px;
  min-width: 60px;
  justify-self: end;
  padding: 4px 0;
}

.keyboard-hud-display.invalid,
.redacted-word.invalid {
  animation: panel-shake 0.28s ease;
}

.keyboard-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 19;
  padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: var(--keyboard-back);
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.2);
  touch-action: manipulation;
}

.keyboard-dock.hidden {
  display: none;
}

.keyboard-grid {
  display: grid;
  gap: 5px;
  touch-action: manipulation;
}

.keyboard-row {
  display: grid;
  gap: 4px;
  touch-action: manipulation;
}

.keyboard-key {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--keyboard-key);
  color: var(--keyboard-key-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: var(--keyboard-font);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  text-transform: lowercase;
  cursor: pointer;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}

.keyboard-key-label {
  display: block;
  line-height: 1;
  transform: translateY(-0.08em);
}

.keyboard-key:active {
  transform: translateY(1px);
}

.keyboard-key:disabled,
.keyboard-key.disabled {
  opacity: 0.33;
  cursor: not-allowed;
}

.keyboard-key:disabled:active,
.keyboard-key.disabled:active {
  transform: none;
}

.keyboard-key.special {
  font-size: 2.5rem;
  font-weight: 800;
  text-transform: uppercase;
}

.keyboard-key.backspace {
  background: var(--keyboard-backspace);
  color: var(--keyboard-backspace-text);
}

.keyboard-key.backspace svg {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.keyboard-key.enter svg {
  width: 32px;
  height: 32px;
  display: block;
}

.keyboard-key.enter {
  background: var(--keyboard-enter);
  color: var(--keyboard-enter-text);
}

.recharge-modal {
  position: absolute;
  inset: 0;
  z-index: 34;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 20px calc(var(--tool-height) + 28px);
}

.recharge-modal.hidden {
  display: none;
}

.recharge-panel {
  position: relative;
  margin-bottom: 20px;
  width: min(100%, 320px);
  border: 4px solid #000;
  border-radius: 24px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 12px;
}

.recharge-panel::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid #000;
}

.recharge-panel::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 13px solid #fff;
}

#rechargeMessage {
  white-space: pre-line;
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.recharge-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.recharge-actions button {
  min-width: 78px;
  border: 2px solid #777;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 7px 10px;
  box-shadow: 2px 3px #aaa;
  cursor: pointer;
}

.recharge-actions button.hidden {
  display: none;
}

.win-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: #222;
  color: #fff;
  padding: 20px;
}

.win-overlay.hidden {
  display: none;
}

.win-panel {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.win-confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.win-confetti-canvas.active {
  opacity: 1;
}

.win-title-image {
  width: min(100%, 360px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.win-player-time {
  font-family: "Courier New", Courier, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-weight: 700;
}

.win-player-time-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.win-player-time-detail {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.win-player-time-prefix {
  color: #fff;
}

.win-player-time-word-wrapper {
  position: relative;
  display: inline-block;
}

.win-player-time-black-bar {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: white;
}

.win-player-time-word {
  position: relative;
  z-index: 2;
  color: black;
}

.win-player-time-meta {
  color: lightgrey;
  font-size: 1rem;
  line-height: 1;
}

.win-player-time-value {
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.win-player-time.hidden {
  display: none;
}

.win-rank-list {
  --win-rank-width: 316px;
  margin-top: 50px;
  display: grid;
  gap: 15px;
  width: min(100%, var(--win-rank-width));
  margin-left: auto;
  margin-right: auto;
  justify-items: stretch;
}

.win-rank-entry {
  width: 100%;
  position: relative;
}

.win-rank {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  width: 100%;
  opacity: 0.42;
  transition: opacity 0.18s ease, border-color 0.18s ease;
}

.win-rank-entry.is-current .win-rank {
  opacity: 1;
  padding: 0;
  outline: 2px solid #fff;
  outline-offset: 10px;
  border-radius: 10px;
}

.win-rank-number {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 0.9;
  text-align: left;
}

.win-rank.level-5 .win-rank-number {
  color: var(--diff-4);
}

.win-rank.level-4 .win-rank-number {
  color: var(--diff-3);
}

.win-rank.level-3 .win-rank-number {
  color: #f4ef16;
}

.win-rank.level-2 .win-rank-number {
  color: var(--diff-2);
}

.win-rank.level-1 .win-rank-number {
  color: var(--diff-1);
}

.win-rank-body {
  min-width: 0;
}

.win-rank-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.win-rank-stats {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 700;
}

.win-actions {
  margin-top: auto;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.win-share-button {
  align-self: flex-end;
  height: 38px;
  padding: 0 12px;
  background: none;
  border-color: #fff;
  box-shadow: 1px 2px rgba(255, 255, 255, 0.35);
  color: #fff;
}

.win-share-button .share-button-icon {
  filter: brightness(0) invert(1);
}

.win-home-button {
  height: 36px;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.win-home-icon {
  width: auto;
  height: 100%;
  display: block;
  filter: brightness(0.5);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 45;
  border: 3px solid var(--ink);
  background: #fff;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  white-space: pre-line;
  line-height: 1.15;
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
  border-radius: 20px;
}

.toast.guess-feedback {
  bottom: calc(var(--keyboard-offset) + 14px);
  font-size: 1.08rem;
  font-weight: 800;
  border-width: 3px;
  padding: 8px 12px;
}

.toast.error {
  top: 50%;
  left: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 24px));
  background: var(--snippet-hit);
  color: #fff;
  border-color: white;
  font-size: 1.6rem;
  font-weight: 900;
  padding: 10px 14px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 1);
}

.toast.error.visible {
  animation: error-toast-message var(--message-duration) ease forwards;
}

.toast.entry-feedback {
  background: #c1121f;
  color: #fff;
  left: 50%;
  bottom: calc(var(--keyboard-offset) + 14px);
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid #7b7b7b;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 2px 3px #8c8c8c;
}

.toast.visible {
  opacity: 1;
}

.toast.hidden {
  display: none;
}

@keyframes indicator-highlight {
  0% {
    transform: scale(1);
    color: #fff;
  }

  40% {
    transform: scale(1.04);
    color: #8be8ff;
  }

  100% {
    transform: scale(1);
    color: #fff;
  }
}

@keyframes level-drop {
  0% {
    color: #fff;
  }

  35% {
    color: #ff8f8f;
  }

  100% {
    color: #fff;
  }
}

@keyframes panel-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-5px);
  }

  40% {
    transform: translateX(5px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}


@keyframes solved-pop {
  0% {
    filter: brightness(1);
    transform: scale(1);
  }

  35% {
    filter: brightness(1.8);
    transform: scale(1.14);
  }

  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

@keyframes victory-pulse {
  0% {
    filter: brightness(1) saturate(1);
  }

  25% {
    filter: brightness(1.18) saturate(1.2);
  }

  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes solve-particle-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
  }
}

@keyframes level-drop-callout {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.92);
  }

  14% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  72% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
}

@keyframes error-toast-message {
  0% {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.92);
  }

  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -52%) scale(0.96);
  }
}

@keyframes tool-badge-hit {
  0% {
    transform: scale(0.7);
    box-shadow: 0 0 0 rgba(209, 19, 45, 0);
  }

  55% {
    transform: scale(1.26);
    box-shadow: 0 0 0 8px rgba(209, 19, 45, 0.18);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  }
}

@keyframes tool-badge-burst-flight {
  0% {
    opacity: 1;
    transform: rotate(var(--tool-badge-burst-angle)) translateY(0) scale(0.1);
  }

  90% {
    opacity: 1;
    transform: rotate(var(--tool-badge-burst-angle)) translateY(-17px) scale(1);
  }

  100% {
    opacity: 0;
    transform: rotate(var(--tool-badge-burst-angle)) translateY(-22px) scale(0.55);
  }
}

@keyframes uv-armed {
  0%,
  100% {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(123, 68, 233, 0.26);
  }
}

@keyframes intro-cover-word {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes intro-show-prefix {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes intro-reveal-word {
  0% {
    color: #000;
    text-shadow: 0 0 0 transparent;
  }
  30% {
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 1),
      0 0 40px rgba(255, 255, 255, 0.8),
      0 0 60px rgba(255, 255, 255, 0.6);
  }
  100% {
    color: #fff;
    text-shadow: 0 0 0 transparent;
  }
}
@font-face {
  font-family: "Roboto Local";
  src: url("./assets/Roboto-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Local";
  src: url("./assets/Roboto-Black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}
