*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 50%, #f0fdf4 100%);
  min-height: 100vh;
  color: #1e293b;
}

.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
}
.header-inner {
  max-width: 640px; margin: 0 auto;
  padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #fb923c, #f43f5e);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(251,146,60,0.35); font-size: 20px;
}
.logo-text h1 { font-size: 17px; font-weight: 800; line-height: 1.2; }
.logo-text p { font-size: 12px; color: #94a3b8; }

.timer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px;
  font-family: monospace; font-size: 17px; font-weight: 700; letter-spacing: 2px;
  background: #f1f5f9; color: #64748b;
  transition: background 0.3s, color 0.3s;
}
.timer.running { background: #1e293b; color: #fff; box-shadow: 0 4px 12px rgba(30,41,59,0.2); }
.timer svg { width: 16px; height: 16px; }
.timer.running svg { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.progress-bar-wrap { height: 4px; background: #f1f5f9; display: none; }
.progress-bar-wrap.visible { display: block; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #fb923c, #10b981);
  border-radius: 999px; transition: width 0.4s ease; width: 0%;
}

.main { max-width: 640px; margin: 0 auto; padding: 24px 16px 120px; }

#screen-idle { text-align: center; padding: 40px 0; }
.hero-icon {
  width: 96px; height: 96px; border-radius: 24px;
  background: linear-gradient(135deg, #fb923c, #f43f5e);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 32px;
  box-shadow: 0 16px 40px rgba(251,146,60,0.3);
  font-size: 44px; transform: rotate(3deg);
}
#screen-idle h2 { font-size: clamp(26px, 6vw, 38px); font-weight: 900; margin-bottom: 12px; }
#screen-idle p.subtitle { color: #64748b; font-size: 17px; max-width: 340px; margin: 0 auto 36px; line-height: 1.6; }

.btn-row {
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; margin-bottom: 20px;
}
@media(min-width: 480px) { .btn-row { flex-direction: row; justify-content: center; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 28px; border-radius: 16px;
  font-size: 15px; font-weight: 700; cursor: pointer; border: none;
  transition: all 0.15s; text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #1e293b; color: #fff; box-shadow: 0 4px 16px rgba(30,41,59,0.2); }
.btn-primary:hover { background: #0f172a; }
.btn-outline { background: #fff; color: #1e293b; border: 2px solid #e2e8f0; }
.btn-outline:hover { border-color: #94a3b8; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 12px; }

.custom-tags {
  margin-top: 24px; background: #fff; border-radius: 16px;
  border: 1px solid #e2e8f0; padding: 16px; text-align: left;
  max-width: 380px; margin-left: auto; margin-right: auto;
}
.custom-tags p { font-size: 13px; font-weight: 600; color: #64748b; margin-bottom: 10px; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; background: #fff7ed; color: #c2410c;
  padding: 4px 10px; border-radius: 999px; border: 1px solid #fed7aa;
}
.pool-info { font-size: 13px; color: #94a3b8; margin-top: 28px; }

#screen-game { display: none; }
.game-topbar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.found-count { font-size: 14px; font-weight: 600; color: #64748b; }
.game-actions { display: flex; gap: 8px; }

.bingo-list { display: flex; flex-direction: column; gap: 10px; }
.bingo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 16px;
  border: 2px solid #e2e8f0; background: #fff;
  cursor: pointer; transition: all 0.2s; text-align: left; width: 100%;
}
.bingo-item:hover:not(.found) {
  border-color: #fdba74; box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: scale(1.01);
}
.bingo-item:active { transform: scale(0.98); }
.bingo-item.found { background: #f0fdf4; border-color: #86efac; transform: scale(0.99); }

.item-badge {
  width: 28px; height: 28px; border-radius: 999px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #94a3b8;
  flex-shrink: 0; transition: all 0.2s;
}
.found .item-badge { background: #22c55e; color: #fff; font-size: 14px; }
.item-label { font-size: 15px; font-weight: 500; color: #334155; transition: all 0.25s; }
.found .item-label {
  text-decoration: line-through; text-decoration-color: #4ade80;
  text-decoration-thickness: 2px; color: #16a34a;
}

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 24px; padding: 32px 28px;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.trophy-icon {
  width: 80px; height: 80px; border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 38px;
  box-shadow: 0 8px 24px rgba(251,146,60,0.3);
}
.victory-title { font-size: 30px; font-weight: 900; margin-bottom: 8px; }
.victory-sub { color: #64748b; font-size: 17px; margin-bottom: 24px; }
.time-box { background: #f8fafc; border-radius: 16px; padding: 20px; margin-bottom: 28px; }
.time-label { font-size: 11px; text-transform: uppercase; letter-spacing: 3px; font-weight: 700; color: #94a3b8; margin-bottom: 4px; }
.time-value { font-family: monospace; font-size: 40px; font-weight: 900; color: #1e293b; }

.add-modal { text-align: left; }
.add-modal h3 { font-size: 20px; font-weight: 800; margin-bottom: 20px; }
.input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.input-field {
  flex: 1; height: 44px; border-radius: 12px;
  border: 2px solid #e2e8f0; padding: 0 14px;
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.input-field:focus { border-color: #94a3b8; }
.btn-remove {
  width: 44px; height: 44px; border-radius: 12px;
  background: #fff; border: 2px solid #e2e8f0;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #94a3b8; transition: all 0.15s;
}
.btn-remove:hover { background: #fef2f2; border-color: #fca5a5; color: #ef4444; }
.inputs-wrap { max-height: 240px; overflow-y: auto; margin-bottom: 12px; }
.btn-add-more {
  width: 100%; height: 40px; border-radius: 12px;
  background: #fff; border: 2px dashed #e2e8f0;
  font-size: 14px; font-weight: 600; color: #64748b;
  cursor: pointer; margin-bottom: 16px; transition: all 0.15s;
}
.btn-add-more:hover { border-color: #94a3b8; color: #475569; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }
.modal-footer .btn { min-width: 120px; }
