/* Base HUD, portrait layout, queue, and upgrade cards. realm-ui.css and ui-polish.css override later. */

/* ---- style.css ---- */

html, body { margin:0; height:100%; overflow:hidden; font-family: Fredoka, Georgia, sans-serif; background:#2a1638; color:#fff8e6; }
#game-container { position:fixed; inset:0; }
#hud { position:fixed; top:12px; left:12px; z-index:5; display:flex; gap:16px; background:rgba(20,10,32,0.88); padding:8px 14px; border-radius:12px; font-size:20px; color:#ffd166; border:1px solid #00d2d3; }
#slots { position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:5; display:flex; gap:8px; }
.slot { width:56px; height:56px; border-radius:10px; background:#3d2a54; border:2px dashed #ffd166; box-sizing:border-box; display:flex; align-items:center; justify-content:center; font-weight:bold; }
.slot.filled { border-style:solid; background:#4a3566; }
#queue { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); z-index:5; display:flex; gap:10px; min-height:72px; }
.cannon-btn { width:72px; height:72px; border-radius:12px; border:2px solid #ffd166; background:#3d2a54; color:#fff8e6; font-family:Fredoka, sans-serif; font-size:22px; font-weight:bold; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1.1; }
.cannon-btn .ammo { font-size:13px; font-weight:normal; color:#00d2d3; }
.cannon-btn:disabled { opacity:0.45; cursor:default; }
.cannon-btn.front { box-shadow:0 0 0 3px #00d2d3; }
#popup { position:fixed; inset:0; z-index:10; display:flex; align-items:center; justify-content:center; background:rgba(16,8,24,0.55); }
#popup.hidden { display:none; }
.popup-card { background:#3d2a54; padding:28px 32px; border-radius:16px; text-align:center; min-width:260px; box-shadow:0 8px 24px rgba(0,0,0,0.4); border:2px solid #ffd166; color:#fff8e6; }
.popup-actions { display:flex; gap:12px; justify-content:center; margin-top:16px; }
#popup button { font-size:18px; padding:10px 20px; border:0; border-radius:10px; background:#00d2d3; color:#1a1020; cursor:pointer; font-family:Fredoka, sans-serif; font-weight:bold; }
#debug { position:fixed; bottom:8px; left:8px; z-index:5; max-width:40vw; max-height:20vh; overflow:auto; font-size:11px; font-family:Consolas, monospace; background:rgba(20,10,32,0.7); padding:6px; border-radius:6px; color:#ffd166; }

/* ---- style-cols.css ---- */

#queue { align-items: flex-end; gap: 14px; }
.queue-col { display: flex; flex-direction: column-reverse; gap: 6px; align-items: center; width: 76px; min-width: 76px; flex: 0 0 76px; }
.queue-col .cannon-btn.stacked { width: 64px; height: 56px; font-size: 18px; transform: none; }
.plus-n { position: fixed; z-index: 8; pointer-events: none; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 28px; color: #ffd166; text-shadow: 0 2px 0 #1a1020, 0 0 8px #1a1020; animation: plus-float 0.7s ease-out forwards; }
@keyframes plus-float { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -48px); } }
.confetti { position: fixed; top: -8px; z-index: 12; width: 8px; height: 14px; pointer-events: none; border-radius: 2px; animation: confetti-fall 1.6s ease-in forwards; }
@keyframes confetti-fall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(540deg); opacity: 0.2; } }

/* ---- layout-portrait.css ---- */

#game-container { position:fixed; top:52px; left:0; right:0; height:54%; bottom:auto; touch-action:none; }
#hud { z-index:8; }
#slots { position:fixed; top:calc(52px + 54%); left:50%; transform:translate(-50%, 8px); bottom:auto; z-index:8; gap:10px; }
.slot { width:64px; height:64px; }
#queue { position:fixed; top:calc(52px + 54% + 80px); left:50%; transform:translateX(-50%); bottom:8px; align-items:flex-start; gap:10px; z-index:8; max-height:calc(46% - 140px); overflow-y:auto; overflow-x:hidden; }
.queue-col { display:flex; flex-direction:column; gap:6px; align-items:center; }
.queue-col .cannon-btn { transition:transform 0.28s ease; }
.queue-col .cannon-btn.stacked { width:64px; height:56px; font-size:18px; }
.slot .cannon-btn { animation:dock-pop 0.28s ease; }
@keyframes dock-pop { from { transform:scale(0.6); opacity:0; } to { transform:scale(1); opacity:1; } }
#debug { bottom:auto; top:8px; right:8px; left:auto; max-width:28vw; }
.popup-card { animation:card-in 0.35s ease; }
@keyframes card-in { from { transform:scale(0.85); opacity:0; } to { transform:scale(1); opacity:1; } }

/* ---- style-upgrades.css ---- */

#hud { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#hud-upgrades { display:flex; gap:6px; align-items:center; }
.upg-icon { width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-family:Fredoka, sans-serif; font-weight:700; font-size:14px; color:#1a1020; border:2px solid #fff8e6; box-shadow:0 2px 0 rgba(0,0,0,0.25); }
#upgrade-popup { position:fixed; inset:0; z-index:20; display:flex; align-items:center; justify-content:center; background:rgba(16,8,24,0.45); }
#upgrade-popup.hidden { display:none; }
.upgrade-card { min-width:320px; max-width:92vw; background:#fff8e6 !important; color:#1a1020 !important; border:3px solid #1a1020 !important; box-shadow:0 10px 0 #1a1020, 0 12px 28px rgba(0,0,0,0.35); padding:28px 32px; border-radius:16px; text-align:center; opacity:1 !important; filter:none !important; }
.upgrade-card h2, .upgrade-card p, #upgrade-word { color:#1a1020 !important; opacity:1 !important; }
.upgrade-card h2 { font-size:28px; font-weight:700; margin:0 0 8px; }
#upgrade-word { font-size:16px; font-weight:700; margin:0; }
.upgrade-choices { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
button.upg-choice { width:110px; min-height:132px; border:3px solid #1a1020; border-radius:14px; cursor:pointer; font-family:Fredoka, sans-serif; color:#1a1020; padding:12px 8px; display:flex; flex-direction:column; align-items:center; gap:6px; box-shadow:0 4px 0 #1a1020; font-weight:700; opacity:1; }
button.upg-choice:active { transform:translateY(2px); box-shadow:0 2px 0 #1a1020; }
.upg-choice .ico { width:36px; height:36px; border-radius:10px; background:#ffffff; color:#1a1020; border:2px solid #1a1020; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:18px; }
.upg-choice .name { font-weight:700; font-size:16px; color:#1a1020; }
.upg-choice .hint { font-size:12px; line-height:1.25; font-weight:600; color:#1a1020; opacity:1; }
#slot-extra.locked { display:none; }
#slot-extra { display:block; }

/* ---- style-queue-fix.css ---- */

.queue-col { width: 76px; min-width: 76px; flex: 0 0 76px; }
.queue-col .cannon-btn.stacked { transform: none; }

/* ---- style-challenge.css ---- */

#popup.lose-popup .popup-card {
  background: #4a1420;
  border: 3px solid #ff6b6b;
  color: #fff8e6;
  box-shadow: 0 10px 0 #7a1020, 0 12px 28px rgba(0,0,0,0.45);
}
#popup.lose-popup #popup-title { color: #ffd166; font-size: 30px; }
#popup.lose-popup #popup-message { color: #fff8e6; font-weight: 600; font-size: 16px; opacity: 1; }
