:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --accent: #2b6ef6;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: #111827;
}

/* Header */
.brand-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 20px;
  background-color: #111;
  color: #fff;
}
.brand-logo { width: 50px; height: 50px; object-fit: contain; }
.brand-title { margin: 0 24px; font-size: 1.8rem; font-weight: 700; }

/* Buttons row */
.brand-actions { margin: 10px auto; }

/* Views */
.hidden { display: none !important; }
.subview { padding: 0 16px; }

/* Dashboard grid */
.dashboard {
  max-width: 1200px;
  margin: 16px auto 24px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* Three equal columns */
  gap: 16px;
  min-height: calc(100vh - 280px);
}

/* Column containers */
.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Left column takes first column */
.left-column {
  grid-column: 1;
}

/* Center column takes middle column */
.center-column {
  grid-column: 2;
}

/* Right column takes last column */
.right-column {
  grid-column: 3;
}

/* Make cards in columns fill height evenly */
.dashboard-column .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-column .card-body {
  flex: 1;
}

/* Responsive layout */
@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }
  
  .center-column {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .left-column,
  .center-column,
  .right-column {
    grid-column: 1;
  }
}

/* Image Slider Section */
.image-slider-section {
  grid-column: 1 / -1; /* Span all columns */
  height: 400px; /* Double the height of other sections */
}

.image-slider-section .carousel {
  height: 100%;
}

.image-slider-section .carousel-inner {
  height: 100%;
}

.image-slider-section .carousel-item {
  height: 100%;
}

.image-slider-section .carousel-item img {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 10px;
}

.carousel-indicators {
  margin-bottom: 1rem;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 4px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(18,38,63,0.06);
  padding: 18px;
}
.card-title { font-weight: 700; margin-bottom: 12px; }

/* Clients */
.client-logos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.client-logo {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  padding: 18px 8px;
  font-weight: 600;
}

/* Column specific styles */
.dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-column .card {
  flex: 1;
  margin: 0;
  min-height: 200px; /* Base height for boxes */
}

/* Center column with image slider */
.center-column {
  grid-row: span 2; /* Make center column span 2 rows */
}

.center-column #imageSlider {
  height: 100%; /* Full height of the 2 rows */
  min-height: 416px; /* 2 * 200px + 16px gap */
}

.center-column .carousel-inner,
.center-column .carousel-item {
  height: 100%;
}

.center-column .carousel-item img {
  height: 100%;
  object-fit: cover;
}

/* Left and right column cards */
.left-column .card,
.right-column .card {
  height: calc((100% - 16px) / 2); /* Split height equally minus gap */
}

.winners-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.winners-list li:last-child {
  border-bottom: none;
}

.client-logos {
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Make the center column's client logos more prominent */
.center-column .client-logo {
  padding: 24px 16px;
  font-size: 1.1rem;
  background: linear-gradient(to bottom right, #f1f5f9, #e2e8f0);
  transition: transform 0.2s ease;
}

.center-column .client-logo:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Ticker */
.ticker-card { overflow: hidden; }
.ticker-viewport {
  position: relative;
  height: 40px;
  overflow: hidden;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
  background: #fff;
}
.ticker-track {
  position: absolute;
  white-space: nowrap;
  will-change: transform;
  animation-name: ticker-move;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  padding: 8px 12px;
  font-weight: 600;
  display: inline-block;
}
.ticker-track span { display: inline-block; margin-right:32px; }
.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-move {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Quiz */
.topbar {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 20px; background:#fff; border-bottom:1px solid #e6e9ef;
  position: sticky; top: 0; z-index: 100;
}
.topbar .brand { font-weight:700; }
.topbar .right { display:flex; gap:12px; align-items:center; }

.coins {
  background: linear-gradient(180deg,#ffd86b,#ffbd00);
  padding:6px 10px; border-radius:8px; font-weight:700;
}

.quiz-card { 
  max-width: 820px; 
  margin: 24px auto; 
}

.quiz-logo {
  height: 40px;
  width: auto;
  margin-right: 12px;
}

.question-header { margin-bottom:12px; }
.question-text { font-size:1.1rem; font-weight:600; }
.options { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.option-btn {
  padding:10px 12px; 
  border-radius:8px; 
  border:1px solid #e6e9ef; 
  background:#fff; 
  cursor:pointer; 
  text-align:left;
}

/* Welcome screens */
#welcomeScreen {
    width: 100%;
    min-height: 400px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('images/logo.png.png') center center no-repeat;
    background-size: contain;
    background-color: #fff; /* Optional: for contrast */
}
.quiz-rules {
  max-width: 600px;
  margin: 0 auto;
}

.rules-list {
  list-style-type: none;
  padding: 0;
  margin: 20px 0;
}

.rules-list li {
  padding: 8px 0;
  position: relative;
  padding-left: 24px;
}

.rules-list li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

#startAdventure {
  font-size: 1.2rem;
  padding: 12px 32px;
  transition: transform 0.2s ease;
}

#startAdventure:hover {
  transform: translateY(-2px);
}

/* User welcome message */
#userName {
  color: var(--accent);
  font-weight: 700;
}
.option-btn:hover { border-color:var(--accent); }

.controls { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
#answerInput { flex:1; padding:10px; border-radius:8px; border:1px solid #e6e9ef; }
button { cursor:pointer; padding:10px 12px; border-radius:8px; border:none; background:var(--accent); color:white; }
button.btn-secondary { background:#e6e9ef; color:#111827; }

.hint-box { margin-top:8px; color:#0b61d6; font-style:italic; }
.msg-box { margin-top:10px; color:#b91c1c; font-weight:600; }

.user-info button {
  background:#fff; color:var(--accent); border:1px solid #e6e9ef; padding:8px 10px; border-radius:8px;
}
.user-info .user-name {
  font-weight: 600;
  margin-right: 12px;
  color: var(--accent);
}

.footer { text-align:center; color:var(--muted); padding:20px 0; }

/* Responsive */
@media (max-width: 900px) {
  .client-logos { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .dashboard { grid-template-columns: 1fr; grid-template-rows: none; }
}