@import url('https://fonts.googleapis.com/css2?family=Inter:wght@700&display=swap');

body {
  min-height: 100vh;
  background: #CFECF3;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 3rem;
}

#film-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .06;
  background-image: repeating-radial-gradient(circle at 50% 50%, rgba(0,0,0,.2) 0, transparent 1px);
  animation: grain 18s linear infinite;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-0.5%, 0.5%); }
  50%  { transform: translate(0.5%, -0.5%); }
  75%  { transform: translate(-0.5%, 0.5%); }
  100% { transform: translate(0, 0); }
}

#projector-flash {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.75), transparent 65%);
  animation: projectorFlash 1.5s ease forwards;
}

@keyframes projectorFlash {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  40%  { opacity: .35; }
  100% { opacity: 0; }
}

#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at 20% 40%, rgba(232,183,160,.5), transparent 40%),
    radial-gradient(circle at 80% 50%, rgba(205,185,215,.4), transparent 40%),
    #111;
  animation: introReveal 2.5s ease forwards;
}

@keyframes introReveal {
  0%   { opacity: 1; transform: scale(1); }
  99%  { opacity: 0; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

#header {
  width: 100%;
  max-width: 500px;
  border-bottom: 0.5px solid #2a2a2a;
  padding: 1.25rem 0 1rem;
  text-align: center;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

#header h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000;
  text-transform: uppercase;
}

#header p {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.008em;
  color: #000;
  text-transform: uppercase;
}

#message-bar {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.5rem;
}

#board {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 1.5rem;
  perspective: 1000px;
}

.tile {
  width: 52px;
  height: 52px;
  border: 0.5px solid #2e2e2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 600;
  font-family: 'Geist', sans-serif;
  letter-spacing: 0.05em;
  color: #e8e3d9;
  background: #141414;
  transition: border-color 0.1s;
  text-transform: uppercase;

  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}


.tile.filled { border-color: #444; }

.tile.correct {
  background-color: #2d4a2d;
  border-color: #2d4a2d;
  color: #ffffff;

  box-shadow:
    0 0 8px rgba(76,175,80,.45),
    0 0 16px rgba(76,175,80,.25);
}
.tile.present {
  background: #4a3d1a;
  border-color: #4a3d1a;
  color: #d4b870;
}

.tile.absent {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.tile.winner { animation: winnerGlow 1s infinite alternate; }

.tile.pop   { animation: pop 0.1s ease; }
.tile.shake { animation: shake 0.4s ease; }
.tile.flip {
  animation: flipTile 0.6s cubic-bezier(.4,0,.2,1);
}

@keyframes flipTile {
  0% {
    transform: rotateX(0deg);
  }

  45% {
    transform: rotateX(-90deg);
  }

  55% {
    transform: rotateX(-90deg);
  }

  100% {
    transform: rotateX(0deg);
  }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  40%       { transform: translateX(4px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

 
@keyframes winnerGlow {
  from { box-shadow: 0 0 10px rgba(76,175,80,.5); }
  to   { box-shadow: 0 0 20px rgba(76,175,80,.9), 0 0 40px rgba(76,175,80,.6); }
}

#keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.kb-row {
  display: flex;
  gap: 5px;
}

.key {
  height: 58px;
  min-width: 42px;
  padding: 0 8px;
  border: none;
  background: #222;
  color: #ccc;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.key:hover   { background: #2e2e2e; }
.key.wide    { min-width: 68px; font-size: 11px; letter-spacing: 0.08em; }
.key.correct { background: #2d4a2d; color: #a8d4a8; }
.key.present { background: #4a3d1a; color: #d4b870; }
.key.absent  { background: #161616; color: #333; }

#hint-section {
  margin-bottom: 1rem;
}

#hint-btn {
  background: none;
  border: 0.5px solid #444;
  color: #222;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 11px;
  padding: 10px 18px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 12px;
}

#hint-btn:hover {
  border-color: #222;
}

#hint-bar {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #333;
  margin-top: 1rem;
  text-align: center;
}

#hint-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#hint-modal-overlay.show {
  display: flex;
}

#hint-modal {
  background: #141414;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 2rem;
  width: 300px;
  text-align: center;
}

#hint-modal h2 {
  color: #e8e3d9;
  margin-bottom: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

#hint-modal button {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  background: #222;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 12px;
}

#hint-modal button:hover {
  background: #333;
}

#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

#modal-overlay.show { display: flex; }

#modal {
  background: #141414;
  border: 0.5px solid #2e2e2e;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 340px;
  width: 90%;
  text-align: center;
}

#modal h2 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: #e8e3d9;
}

#modal .answer-reveal {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 1rem;
}

#modal .answer-word {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 0.2em;
  color: #d4b870;
  margin-bottom: 1.5rem;
}

#modal p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
}

#next-puzzle-timer {
  margin-bottom: 1.5rem;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #d4b870;
}

#title-screen {
  position: fixed;
  inset: 0;
  background: #CFECF3;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Geist', sans-serif;
}

#title-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#title-heading {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #000000;
}

#title-tagline {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  color: #000000;
  max-width: 300px;
  line-height: 1.5;
}

#title-date {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #111;
  text-transform: uppercase;
}

#title-buttons {
  display: flex;
  gap: 12px;
  margin-top: 0.5rem;
}

#play-btn {
  padding: 12px 36px;
  border: none;
  background: #111;
  color: #fff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

#play-btn:hover {
  background: #333;
}

#letterboxd-footer {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

#letterboxd-logo {
  width: 80px;
  opacity: 1;
}