@import url('https://fonts.googleapis.com/css2?family=Gabarito:wght@400;600;700&family=Baloo+2:wght@500;700;800&display=swap');

:root {
  --ink: #141632;
  --muted: #4a4f7c;
  --bg: #f3f4fb;
  --panel: #ffffff;
  --accent: #ff9c2a;
  --accent-2: #148a3a;
  --accent-3: #2b2fd6;
  --accent-4: #0b0f3c;
  --line: rgba(24, 28, 64, 0.12);
  --shadow: 0 18px 40px rgba(17, 20, 52, 0.14);
  --glow: 0 0 0 3px rgba(43, 47, 214, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Baloo 2', cursive;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), rgba(240, 242, 255, 0.95) 55%, rgba(230, 233, 248, 0.95) 100%);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: none;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 {
  font-family: 'Gabarito', sans-serif;
  letter-spacing: 0.6px;
}

a {
  color: inherit;
}

.admin-nav {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(240, 244, 255, 0.9));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(16, 22, 64, 0.1);
  backdrop-filter: blur(8px);
}

.admin-brand {
  color: var(--accent-4);
  letter-spacing: 2px;
}

.admin-links a {
  background: rgba(43, 47, 214, 0.12);
  color: var(--accent-4);
  border: 1px solid rgba(43, 47, 214, 0.18);
  border-radius: 14px;
}

.admin-links a.active {
  background: var(--accent-3);
  color: #fff;
  border-color: transparent;
}

.container {
  max-width: 1200px;
}

.header,
.panel,
.card,
.game-card,
.form-card,
.grid,
.sidebar {
  background: var(--panel);
  border-radius: 24px;
  border: 1px solid rgba(43, 47, 214, 0.08);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.header {
  position: relative;
  overflow: hidden;
}

.header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(212, 106, 31, 0.1), transparent 60%);
  pointer-events: none;
}

.button,
.btn,
.action-button,
.primary-button,
.secondary-button,
button {
  font-family: 'Gabarito', sans-serif;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #ffb35c);
  color: #fff;
  box-shadow: 0 10px 18px rgba(255, 156, 42, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover,
.button:hover,
.btn:hover,
.action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(212, 106, 31, 0.3);
}

.button.secondary,
.btn.secondary,
.action-button.secondary {
  background: linear-gradient(135deg, var(--accent-2), #22b35a);
}

.button.ghost,
.btn.ghost {
  background: rgba(43, 47, 214, 0.08);
  color: var(--accent-4);
  border: 1px solid rgba(43, 47, 214, 0.2);
  box-shadow: none;
}

.badge,
.tag,
.pill {
  background: rgba(20, 138, 58, 0.12);
  color: var(--accent-2);
  border: 1px solid rgba(20, 138, 58, 0.22);
}

input,
select,
textarea {
  font-family: 'Gabarito', sans-serif;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--glow);
  border-color: var(--accent-3);
}

.cell.active,
.card.active,
.game-card:hover {
  box-shadow: var(--glow);
}

.game-card {
  position: relative;
  overflow: hidden;
}

.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(64, 120, 255, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.pipeline-flow,
.stat-card,
.health-card,
.control-group,
.control-panel,
.review-card,
.queue-card,
.table-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(43, 47, 214, 0.1);
  border-radius: 20px;
  box-shadow: 0 12px 26px rgba(19, 24, 72, 0.12);
}

.stat-card,
.health-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before,
.health-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(43, 47, 214, 0.08), transparent 60%);
  pointer-events: none;
}

.table,
table {
  border-radius: 18px;
  overflow: hidden;
}

/* Motion */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body > .admin-nav,
.header,
.board,
.grid,
.sidebar,
.pipeline-flow,
.stats,
.health-panels,
.controls,
.game-card,
.stat-card,
.health-card,
.review-card,
.queue-card {
  animation: fadeUp 0.5s ease both;
}

.game-card:nth-child(1),
.stat-card:nth-child(1),
.health-card:nth-child(1) { animation-delay: 0.05s; }
.game-card:nth-child(2),
.stat-card:nth-child(2),
.health-card:nth-child(2) { animation-delay: 0.1s; }
.game-card:nth-child(3),
.stat-card:nth-child(3),
.health-card:nth-child(3) { animation-delay: 0.15s; }
.game-card:nth-child(4),
.stat-card:nth-child(4),
.health-card:nth-child(4) { animation-delay: 0.2s; }
.game-card:nth-child(5),
.stat-card:nth-child(5),
.health-card:nth-child(5) { animation-delay: 0.25s; }

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Play mode: remove admin chrome for focused gameplay */
body.play-mode .admin-nav {
  display: none !important;
}

body.play-mode .container,
body.play-mode .setup-screen,
body.play-mode .play-screen {
  margin-top: 20px !important;
}

/* Multiplayer shell overrides */
.game-container {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(43, 47, 214, 0.2) !important;
  box-shadow: 0 20px 50px rgba(17, 20, 52, 0.18) !important;
  color: var(--ink) !important;
  position: relative;
  overflow: hidden;
}

.game-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/kilowi_assets/Pattern.png');
  background-size: 220px 220px;
  opacity: 0.08;
  pointer-events: none;
}

.game-header h1 {
  color: var(--accent-3) !important;
  background: linear-gradient(120deg, var(--accent-3), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none !important;
  filter: none !important;
}

.hamburger-btn {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-2)) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 10px 22px rgba(43, 47, 214, 0.25) !important;
}

.hamburger-line {
  background: #fff !important;
  box-shadow: none !important;
}

.dropdown-menu {
  background: #10143a !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 16px 40px rgba(16, 20, 58, 0.45) !important;
}

.menu-item {
  color: #fff !important;
}

.menu-item:hover {
  background: rgba(43, 47, 214, 0.35) !important;
}

.control-btn {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-4)) !important;
  color: #fff !important;
}

.kilowi-card {
  background: linear-gradient(180deg, #2f33b5 0%, #1c1f7a 100%) !important;
  border-radius: 28px !important;
  box-shadow: 0 18px 36px rgba(14, 18, 70, 0.28) !important;
}

.kilowi-card::before {
  background-image: url('/kilowi_assets/Pattern.png') !important;
  background-size: 120px 120px !important;
  opacity: 0.16 !important;
}

.card-header {
  background: rgba(9, 13, 42, 0.65) !important;
}

.card-body {
  background: #f7f8ff !important;
  color: #1c1f3f !important;
}

.guess-secondary {
  color: var(--accent) !important;
}

.table,
.list,
.grid {
  border-color: var(--line);
}

.status,
.helper-text {
  color: var(--muted);
}

@media (max-width: 800px) {
  .header h1 {
    font-size: 22px;
  }
}
