:root {
--bg: #05050a; --surface: rgba(20, 20, 35, 0.6); --text: #e0e0e8;
--primary: #8b5cf6; --green: #4ade80; --yellow: #facc15; --red: #f87171; --shadow: #a855f7;
--radius: 18px; --font: system-ui, -apple-system, sans-serif;
--glass: rgba(255, 255, 255, 0.06); --border: rgba(255, 255, 255, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  background: radial-gradient(circle at top, #111122, var(--bg)); 
  color: var(--text); 
  font-family: var(--font); 
  height: 100vh; 
  overflow: hidden;
  position: relative; 
  touch-action: manipulation; 
}
#particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.screen { 
  display: none; 
  height: 100vh; 
  flex-direction: column; 
  padding: 16px;
  overflow-y: auto;
}
.screen.active { display: flex; animation: fadeIn 0.4s; }
.hidden { display: none !important; }
#setup { align-items: center; justify-content: center; gap: 16px; }
.glass-panel { background: var(--glass); backdrop-filter: blur(14px); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: 0 8px 32px rgba(0,0,0,0.35); margin-bottom: 12px; }
.setup-group, .draft-panel { width: 100%; display: flex; flex-direction: column; gap: 10px; }
input, textarea { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(0,0,0,0.25); color: var(--text); font-size: 14px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); }
button { padding: 14px; border: none; border-radius: var(--radius); background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; font-weight: 600; cursor: pointer; font-size: 15px; transition: 0.15s; width: 100%; margin-top: 8px; }
button:active { transform: scale(0.97); }
button.outline { background: transparent; border: 1px solid var(--border); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.draft-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cat-btn { background: #2a2a3a; font-size: 13px; }
.cat-btn[data-cat="light"] { border: 1px solid var(--green); }
.cat-btn[data-cat="medium"] { border: 1px solid var(--yellow); }
.cat-btn[data-cat="heavy"] { border: 1px solid var(--red); }
.cat-btn[data-cat="shadow"] { border: 1px solid var(--shadow); }
#draft-pool { max-height: 140px; overflow-y: auto; background: rgba(0,0,0,0.2); padding: 8px; border-radius: 10px; margin-bottom: 10px; }
.pool-item { padding: 8px; border-bottom: 1px solid #333; cursor: pointer; font-size: 13px; text-align: left; }
.pool-item:hover { background: rgba(255,255,255,0.1); }
.draft-summary { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: 8px; }
#game header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.player { opacity: 0.4; transition: 0.3s; font-size: 16px; }
.player.active { opacity: 1; text-shadow: 0 0 10px var(--primary); }
.heat-container { flex: 1; margin: 0 12px; height: 10px; background: #333; border-radius: 5px; overflow: hidden; position: relative; }
.heat-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow), var(--red), var(--shadow)); width: 0%; transition: width 0.5s; }
#heat-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 11px; color: #fff; font-weight: bold; text-shadow: 0 0 2px #000; }
.phase-tag { text-align: center; font-size: 13px; color: var(--yellow); margin-bottom: 6px; }
main { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; overflow-y: auto; }
.card-container { perspective: 1200px; width: 260px; height: 350px; margin: 0 auto; position: relative; }
.card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.card.flipped { transform: rotateY(180deg); }
.card-front, .card-back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; font-size: 17px; line-height: 1.3; background: linear-gradient(135deg, #1f1f2e, #141420); border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0,0,0,0.4); }
.card-back { background: linear-gradient(135deg, #2d1b2e, #1a0f1a); transform: rotateY(180deg); border: 2px solid var(--cat-color, #8b5cf6); box-shadow: 0 0 18px var(--cat-color, #8b5cf6); }
.manual-controls { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; width: 100%; max-width: 340px; }
.lvl-btn { padding: 10px; font-size: 13px; background: #2a2a3a; border: 1px solid var(--border); color: var(--text); margin: 0; }
.controls, .safety, .caught-tracker { width: 100%; max-width: 340px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-action { flex: 1; min-width: 90px; background: #2a2a3a; margin: 0; }
.safety-btn { flex: 1; min-width: 70px; color: #000; font-weight: bold; margin: 0; }
.green { background: var(--green); } .yellow { background: var(--yellow); } .red { background: var(--red); }
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 250; }
.modal { max-width: 92%; width: 330px; text-align: center; gap: 14px; display: flex; flex-direction: column; max-height: 85vh; padding: 20px; }
.scrollable { overflow-y: auto; max-height: 50vh; padding-right: 6px; }
.timer-wrapper { width: 100%; height: 8px; background: #333; border-radius: 4px; overflow: hidden; position: relative; }
.timer-bar { height: 100%; background: linear-gradient(90deg, var(--primary), #f43f5e); width: 100%; transition: width 1s linear; }
#mini-timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 12px; color: #fff; margin-top: 14px; font-weight: bold; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseHeat { 0%,100% { text-shadow: 0 0 4px var(--yellow); } 50% { text-shadow: 0 0 12px var(--yellow); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.player.active { animation: pulseHeat 2s infinite; }
.card-container { animation: float 5s ease-in-out infinite; }
@media (min-width: 600px) { .card-container { width: 300px; height: 400px; } }
