*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0c0c0e;
  --code-bg: rgba(12, 12, 14, 0.92);
  --code-text: #c4c4c8;
  --code-accent: #7c8aff;
  --hint: rgba(255, 255, 255, 0.4);
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: var(--bg);
  font-family: "JetBrains Mono", "SF Mono", Consolas, monospace;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.canvas {
  position: relative;
  width: min(90vw, 720px);
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  touch-action: none;
}

.image-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image:
    url("assets/reveal.png"),
    linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.code-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--code-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  cursor: crosshair;
  transition: opacity 0.06s ease-out;
  pointer-events: auto;
}

.code-inner {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-block {
  font-size: clamp(0.65rem, 1.8vw, 0.85rem);
  line-height: 1.6;
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}

.code-block .liquid-word {
  display: inline-block;
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1),
              opacity 0.4s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

.hint {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--hint);
  text-align: center;
  max-width: 90%;
  z-index: 10;
}

.hint-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hint-desktop {
    display: none;
  }
  .hint-mobile {
    display: inline;
  }
}
