/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --blue:       #8597bf;
  --blue-light: #b3c8f8;
  --dark:       #1a1a2e;
  --white:      #ffffff;
  --pink:       #e040a0;
  --card-bg:    rgba(255, 255, 255, 0.94);
  --card-border:rgba(179, 200, 248, 0.45);
  --shadow:     0 8px 32px rgba(0, 0, 0, 0.12);
  --radius:     14px;
  --speed:      0.25s;
  --checker:    150px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--dark);
  overflow-x: hidden;
}

/* ============================================================
   Checkerboard background
   ============================================================ */
body {
  background-color: var(--blue);
  background-image:
    linear-gradient(45deg, var(--blue-light) 25%, transparent 25%),
    linear-gradient(-45deg, var(--blue-light) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--blue-light) 75%),
    linear-gradient(-45deg, transparent 75%, var(--blue-light) 75%);
  background-size: var(--checker) var(--checker);
  background-position:
    0 0,
    0 calc(var(--checker) / 2),
    calc(var(--checker) / 2) calc(var(--checker) / -2),
    calc(var(--checker) / -2) 0;
}

/* ============================================================
   Canvas (emote rain — fixed, behind everything)
   ============================================================ */
#emote-rain-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 16px;
}

main { display: flex; flex-direction: column; gap: 28px; }

/* ============================================================
   Cards (shared) — header excluded, it floats freely
   ============================================================ */
.current-raid,
.schedule-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ============================================================
   Header — logo floats on the background, no box
   ============================================================ */
.header {
  padding: 12px 0 0;
  text-align: center;
}

.header-content {
  display: flex;
  justify-content: center;
}

.logo-image {
  max-width: 560px;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.25));
  /* The PNG has transparent padding at the bottom — crop it out */
  margin-bottom: -40px;
}

.subtitle {
  font-size: 0.9em;
  color: #888;
  letter-spacing: 0.4px;
}

/* ============================================================
   Schedule Section
   ============================================================ */
.schedule-section { padding: 28px; }

.schedule-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.schedule-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.schedule-title {
  font-size: 1.6em;
  color: var(--dark);
}
.timezone-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.timezone-selector label {
  font-size: 0.9em;
  font-weight: 600;
  color: #555;
}

.timezone-selector select {
  padding: 7px 12px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: white;
  color: var(--dark);
  font-size: 0.9em;
  cursor: pointer;
  transition: border-color var(--speed), box-shadow var(--speed);
}
.timezone-selector select:hover  { border-color: var(--blue-light); }
.timezone-selector select:focus  { outline: none; box-shadow: 0 0 0 3px rgba(133,151,191,.25); }

/* ============================================================
   Current Raid Section
   ============================================================ */
.current-raid { padding: 28px; }

.current-raid-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Stream embed */
.stream-container { width: 100%; }

.stream-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}

.stream-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.embed-placeholder {
  color: white;
  font-size: 1.1em;
  opacity: .8;
}

/* Raid info panel */
.raid-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card {
  padding: 18px 20px;
  border-radius: 10px;
  background: rgba(133,151,191,.08);
  border-left: 4px solid var(--blue);
}

.card-label {
  display: block;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 6px;
}

.streamer-name,
.next-streamer {
  font-size: 1.7em;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  word-break: break-word;
}

.twitch-link {
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9em;
  text-decoration: none;
  transition: color var(--speed);
}
.twitch-link:hover { color: #6277a8; text-decoration: underline; }

/* Stats row */
.raid-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  padding: 14px;
  border-radius: 10px;
  background: rgba(133,151,191,.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label { font-size: .78em; color: #999; text-transform: uppercase; letter-spacing: .5px; }
.stat-value  { font-size: 1.4em; font-weight: 700; color: var(--blue); }
.slot-value  { font-size: 1em; }

/* Countdown */
.countdown-card { border-left-color: var(--pink); text-align: center; }

.countdown {
  font-size: 2.6em;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 3px;
  color: var(--pink);
  animation: pulse-count 1s ease-in-out infinite;
}

@keyframes pulse-count {
  0%, 100% { opacity: 1; }
  50%       { opacity: .75; }
}

/* Next target */
.next-target-card { border-left-color: #9c7ecc; }

/* Day Tabs */
.day-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 20px;
  padding-bottom: 0;
}

.day-tab {
  padding: 10px 22px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: .95em;
  font-weight: 600;
  color: #aaa;
  border-radius: 6px 6px 0 0;
  transition: color var(--speed), border-color var(--speed), background var(--speed);
}
.day-tab:hover  { color: var(--blue); background: rgba(133,151,191,.06); }
.day-tab.active { color: var(--blue); border-bottom-color: var(--blue); background: rgba(133,151,191,.1); }

/* Column headers */
.schedule-header {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr;
  gap: 12px;
  padding: 8px 14px;
  font-size: .78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #999;
  border-bottom: 1px solid #eee;
  margin-bottom: 6px;
}

/* Schedule list */
.schedule { display: flex; flex-direction: column; }

.schedule-entry {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 8px;
  transition: background var(--speed), transform var(--speed);
  position: relative;
}

.schedule-entry:not(:last-child) {
  border-bottom: 1px solid rgba(0,0,0,.04);
}

.schedule-entry:hover {
  background: rgba(133,151,191,.1);
  transform: translateX(3px);
}

/* ── Progress indicator column ── */
.progress-col {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #bbb;
  font-size: .9em;
}

/* Current slot */
.schedule-entry.current {
  background: linear-gradient(90deg, rgba(224,64,160,.12), rgba(133,151,191,.08));
  border-left: 4px solid var(--pink);
  border-radius: 0 8px 8px 0;
}

.schedule-entry.current .progress-col {
  color: var(--pink);
}

.train-icon {
  display: inline-block;
  font-size: 1.4em;
  animation: rainbow-glow 2s linear infinite, train-bounce .6s ease-in-out infinite alternate;
}

@keyframes rainbow-glow {
  0%   { filter: drop-shadow(0 0 8px #ff0000) drop-shadow(0 0 16px #ff000088); }
  14%  { filter: drop-shadow(0 0 8px #ff8800) drop-shadow(0 0 16px #ff880088); }
  28%  { filter: drop-shadow(0 0 8px #ffff00) drop-shadow(0 0 16px #ffff0088); }
  42%  { filter: drop-shadow(0 0 8px #00cc00) drop-shadow(0 0 16px #00cc0088); }
  57%  { filter: drop-shadow(0 0 8px #0088ff) drop-shadow(0 0 16px #0088ff88); }
  71%  { filter: drop-shadow(0 0 8px #4400ff) drop-shadow(0 0 16px #4400ff88); }
  85%  { filter: drop-shadow(0 0 8px #cc00ff) drop-shadow(0 0 16px #cc00ff88); }
  100% { filter: drop-shadow(0 0 8px #ff0000) drop-shadow(0 0 16px #ff000088); }
}

@keyframes train-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-3px); }
}

.track-icon { color: #ccc; letter-spacing: -1px; font-size: .7em; }

/* Slot info columns */
.slot-num { font-weight: 700; color: var(--blue); font-size: .85em; }

.slot-time {
  font-size: .88em;
  color: #555;
  line-height: 1.4;
}

.streamer-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--speed);
}
.streamer-link:hover { color: #6277a8; text-decoration: underline; }

.schedule-entry.current .streamer-link { color: var(--pink); font-size: 1.05em; }

.raid-target {
  color: #aaa;
  font-size: .88em;
}

.raid-target.live { color: var(--blue); font-weight: 600; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  text-align: center;
  padding: 16px;
  font-size: .88em;
  color: rgba(26,26,46,.7);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .current-raid-content { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .schedule-header,
  .schedule-entry { grid-template-columns: 72px 1fr 1fr; }
  .col-raid-target,
  .raid-target { display: none; }
}

@media (max-width: 600px) {
  .container { padding: 12px; gap: 16px; }
  .header { padding: 20px; }
  .logo-image { max-width: 300px; }
  .current-raid { padding: 16px; }
  .raid-stats { grid-template-columns: 1fr; }
  .countdown { font-size: 2em; }
  .streamer-name, .next-streamer { font-size: 1.35em; }
  .schedule-header,
  .schedule-entry { grid-template-columns: 60px 1fr 1fr; }
  .day-tab { padding: 8px 14px; font-size: .85em; }
}
