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

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Outfit', sans-serif; }
body, html { height: 100%; width: 100%; overflow: hidden; background-color: #0b0f19; }

#game-ui { display: flex; flex-direction: column; height: 100vh; }

/* Top Bar */
#top-bar {
  height: 64px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  display: flex;
  align-items: center;
  padding: 0 24px;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

#round-counter {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Clickable Target Badge */
#target-display {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.clickable-target {
  cursor: pointer;
}

.clickable-target:hover {
  background: rgba(56, 189, 248, 0.15);
}

#target-name {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.2rem;
  font-weight: 800;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

#timer-display {
  padding: 6px 16px;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  transition: all 0.3s ease;
}

.timer-normal {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #38bdf8;
}

.timer-warning {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  animation: pulse 1s infinite;
}

.timer-critical {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #f87171;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  animation: pulse 0.5s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Clickable Copy Room Badge */
#room-info {
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#room-info:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: white;
}

#room-code { color: #f1f5f9; font-weight: 800; letter-spacing: 1px; }

#score-display { font-size: 1.05rem; color: #e2e8f0; }
#player-score { color: #4ade80; font-weight: 800; }

.header-actions { display: flex; gap: 8px; }

#submit-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

#submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

#submit-btn:disabled {
  background: #334155;
  color: #94a3b8;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-red-outline {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #f87171;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-red-outline:hover {
  background: #ef4444;
  color: white;
}

#map-container { position: relative; display: flex; flex: 1; }
#map { width: 40%; height: 100%; transition: width 0.3s ease; }
#pano { width: 60%; height: 100%; transition: width 0.3s ease; }

#toggle-map-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#toggle-map-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #38bdf8;
}

/* Definition Modal Styling */
.def-title {
  color: #38bdf8;
  font-size: 1.4rem;
  margin: 10px 0;
}

.def-body {
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: left;
  background: #1e293b;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-actions { display: flex; justify-content: center; }

/* Floating Panels */
.floating-panel {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 540px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 20px 28px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  color: #f8fafc;
  text-align: center;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1.15rem;
}

.tags-group { display: flex; gap: 8px; }
.center-header { justify-content: center; }

.panel-actions {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-large {
  font-size: 1.1em;
  padding: 12px 28px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: #334155;
  color: #f8fafc;
}
.btn-secondary:hover {
  background: #475569;
}

.tag {
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tag-timer {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

/* Match Settings Form */
.setting-group { margin: 18px 0; text-align: left; }
.setting-group label { display: block; font-weight: 800; font-size: 0.95rem; color: #e2e8f0; margin-bottom: 6px; }
.setting-desc { font-size: 0.8rem; color: #94a3b8; margin-top: 2px; }
.toggle-group { display: flex; justify-content: space-between; align-items: center; }
.toggle-group input[type="checkbox"] { width: 24px; height: 24px; cursor: pointer; }

select {
  width: 100%;
  padding: 10px;
  background: #1e293b;
  border: 1px solid #334155;
  color: white;
  border-radius: 8px;
  font-weight: 700;
}

#toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease-out forwards;
}

.toast-info { background: rgba(30, 58, 138, 0.95); border: 1px solid #3b82f6; }
.toast-warning { background: rgba(120, 53, 15, 0.95); border: 1px solid #f59e0b; }
.toast-success { background: rgba(6, 78, 59, 0.95); border: 1px solid #10b981; }
.toast-error { background: rgba(127, 29, 29, 0.95); border: 1px solid #ef4444; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 32px;
  border-radius: 16px;
  text-align: center;
  min-width: 380px;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.sub-heading { color: #94a3b8; margin-bottom: 15px; font-weight: bold; }

.guest-status-text {
  margin-top: 15px;
  color: #38bdf8;
  font-size: 0.9rem;
  font-weight: 700;
  animation: pulse 1.5s infinite;
}

#leaderboard-container { margin: 20px 0; display: flex; flex-direction: column; gap: 8px; }

.lb-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 18px;
  background: #1e293b;
  border-radius: 8px;
  font-weight: 800;
  color: #f8fafc;
}

.lb-row:nth-child(1) { background: rgba(245, 158, 11, 0.15); border: 1px solid #f59e0b; color: #fbbf24; }
.lb-row:nth-child(2) { background: rgba(148, 163, 184, 0.15); border: 1px solid #94a3b8; color: #e2e8f0; }
.lb-row:nth-child(3) { background: rgba(180, 83, 9, 0.15); border: 1px solid #b45309; color: #fcd34d; }

.end-game-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.hidden { display: none !important; }
.vote-buttons { margin-top: 14px; display: flex; gap: 12px; justify-content: center; }
.waiting-text { margin-top: 10px; color: #94a3b8; font-style: italic; font-weight: 700; }

button {
  padding: 10px 20px;
  border: none;
  background: #10b981;
  color: white;
  font-weight: 800;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: #059669; }
button:disabled { background: #334155; color: #94a3b8; cursor: not-allowed; }
.btn-green { background: #10b981; }
.btn-green:hover { background: #059669; }
.btn-red { background: #ef4444; }
.btn-red:hover { background: #dc2626; }

input[type="text"] {
  padding: 12px;
  margin: 12px 0;
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  color: white;
  border-radius: 8px;
  font-weight: 700;
}
input[type="text"]:focus { outline: none; border-color: #38bdf8; }

/* Category Selection Grid */
.settings-modal-box {
  max-width: 540px !important;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
  max-height: 180px;
  overflow-y: auto;
  background: #1e293b;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.cat-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
}

.cat-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
