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

html, body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  color: #1a1a1b;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  border-bottom: 1px solid #d3d6da;
  padding: 12px 12px 10px;
  text-align: center;
  background: white;
  position: relative;
}

.menu-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #1a1a1b;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  line-height: 1;
}
.menu-toggle:hover { background: #f0f0f0; }
.menu-toggle:active { transform: translateY(-50%) scale(0.92); }

.brand {
  font-size: 12px;
  color: #6aaa64;
  letter-spacing: 0.28em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

header h1 {
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.day-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.day-counter {
  font-size: 12px;
  color: #787c7e;
  letter-spacing: 0.05em;
  min-width: 88px;
  text-align: center;
}

.day-arrow {
  background: none;
  border: none;
  color: #1a1a1b;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 4px;
  font-family: inherit;
}
.day-arrow:hover { background: #f0f0f0; }
.day-arrow:disabled {
  color: #d3d6da;
  cursor: not-allowed;
}
.day-arrow:disabled:hover { background: none; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.message {
  min-height: 22px;
  font-size: 14px;
  color: #d62828;
  font-weight: 600;
  margin: 4px 0 8px;
  text-align: center;
}

.board {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  width: 100%;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  width: 100%;
  transition: transform 0.1s;
}

.tile {
  width: var(--tile-size, 56px);
  height: var(--tile-size, 56px);
  border: 2px solid #d3d6da;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--tile-size, 56px) * 0.5);
  font-weight: 700;
  text-transform: uppercase;
  background: white;
  color: #1a1a1b;
  line-height: 1;
}

.tile.gap {
  width: calc(var(--tile-size, 56px) * 0.35);
  border: none;
  background: transparent;
}

.tile.filled {
  border-color: #878a8c;
  animation: pop 0.1s ease;
}

@keyframes pop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.tile.green { background: #6aaa64; border-color: #6aaa64; color: white; }
.tile.yellow { background: #c9b458; border-color: #c9b458; color: white; }
.tile.gray { background: #787c7e; border-color: #787c7e; color: white; }

.row.shake { animation: shake 0.45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 500px;
  padding: 8px 4px 16px;
  margin-top: auto;
}

.keyboard-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  touch-action: manipulation;
}

.key {
  flex: 1;
  height: 52px;
  background: #d3d6da;
  color: #1a1a1b;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.key:active { transform: scale(0.95); }

.key.wide {
  flex: 1.5;
  font-size: 11px;
}

.key.green { background: #6aaa64; color: white; }
.key.yellow { background: #c9b458; color: white; }
.key.gray { background: #787c7e; color: white; }

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -120px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  animation: confetti-fall linear forwards;
  will-change: transform, opacity;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(115vh) rotate(var(--spin, 720deg)); opacity: 0; }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }

.modal-content {
  background: white;
  padding: 28px 24px;
  border-radius: 10px;
  text-align: center;
  max-width: 90%;
  width: 360px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal-content h2 { margin-bottom: 14px; font-size: 22px; }
.modal-content p { margin-bottom: 8px; color: #555; }
.modal-content #modalAnswer {
  font-weight: 700;
  color: #1a1a1b;
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.modal-buttons {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.modal-content button {
  padding: 10px 22px;
  border: none;
  border-radius: 6px;
  background: #6aaa64;
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.modal-content button#closeBtn {
  background: #787c7e;
}

.loss-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: loss-fade 0.25s ease-out;
}
@keyframes loss-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loss-popup-content {
  background: white;
  padding: 28px 24px 24px;
  border-radius: 12px;
  text-align: center;
  max-width: 92%;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: loss-pop 0.45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes loss-pop {
  0%   { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.05) rotate(2deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.loss-title {
  font-size: 56px;
  font-weight: 900;
  color: #8B4513;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 4px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.08);
}

.loss-subtitle {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.loss-image {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  margin: 0 auto 14px;
  display: block;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.loss-answer {
  font-size: 14px;
  color: #555;
  margin-bottom: 14px;
}
.loss-answer strong {
  color: #1a1a1b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.loss-close {
  padding: 10px 28px;
  border: none;
  border-radius: 6px;
  background: #787c7e;
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  max-width: 80vw;
  background: white;
  border-right: 1px solid #d3d6da;
  padding: 20px 18px;
  z-index: 400;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}
.sidebar.open { transform: translateX(0); }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 390;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #787c7e;
  margin-bottom: 14px;
  padding: 0 4px;
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.game-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a1b;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
.game-link:hover:not(.disabled) { background: #f4f4f5; }
.game-link.active { background: #f0f8ee; color: #1a1a1b; }
.game-link.disabled {
  color: #b8b8b8;
  cursor: not-allowed;
  opacity: 0.85;
}

.game-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d3d6da;
  flex-shrink: 0;
}
.game-link.active .game-dot { background: #6aaa64; }

.game-name { flex: 1; }

.soon-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: #f0f0f0;
  color: #787c7e;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.report-btn {
  margin-top: 18px;
  padding: 12px 14px;
  background: #6aaa64;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.1s;
}
.report-btn:hover { background: #5d9657; }
.report-btn:active { transform: scale(0.97); }

.sidebar-footer {
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #b8b8b8;
  text-align: center;
  font-weight: 600;
}

/* Report modal */
.report-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.report-modal.hidden { display: none; }

.report-modal-content {
  background: white;
  padding: 24px 22px;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  user-select: text;
  -webkit-user-select: text;
}

.report-modal-content h2 {
  font-size: 22px;
  margin-bottom: 4px;
}
.report-sub {
  font-size: 13px;
  color: #787c7e;
  margin-bottom: 16px;
}
.report-modal-content label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 12px 0 6px;
}
.report-modal-content select,
.report-modal-content textarea,
.report-modal-content input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d3d6da;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: #1a1a1b;
  background: white;
  resize: vertical;
}
.report-modal-content select:focus,
.report-modal-content textarea:focus,
.report-modal-content input:focus {
  outline: none;
  border-color: #6aaa64;
}
.report-modal-content textarea { min-height: 90px; }

.report-buttons {
  margin-top: 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.report-cancel,
.report-send {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}
.report-cancel { background: #e5e5e5; color: #1a1a1b; }
.report-send { background: #6aaa64; color: white; }
.report-send:disabled { opacity: 0.7; cursor: wait; }

/* Prank popup */
.prank-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  animation: prank-fade 0.2s ease;
}
.prank-popup.hidden { display: none; }
@keyframes prank-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.prank-content {
  text-align: center;
  animation: prank-pop 0.5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes prank-pop {
  0%   { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.1) rotate(4deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.prank-message {
  font-size: 88px;
  font-weight: 900;
  color: white;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  text-shadow: 4px 4px 0 #6aaa64, 8px 8px 30px rgba(0,0,0,0.4);
  margin-bottom: 28px;
  font-family: 'Impact', 'Arial Black', sans-serif;
}
@media (max-width: 480px) {
  .prank-message { font-size: 64px; }
}

.prank-close {
  background: white;
  border: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  font-family: inherit;
  transition: transform 0.15s;
}
.prank-close:hover { transform: scale(1.1); }
.prank-close:active { transform: scale(0.95); }
