* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #4a7c43;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.10) 100%);
  min-height: 100vh;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden;
  user-select: none;
  color: #fff;
  margin: 0;
  padding: 0;
}

/* ── 3-column full-page layout ── */
#page-layout {
  display: flex;
  align-items: stretch;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#left-panel,
#right-panel {
  flex: 0 0 160px;
  /* Sabit 160px — buradan ayarlayabilirsiniz */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#left-panel img,
#right-panel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  /* Kalan tüm alanı al */
  min-width: 0;
  padding: 10px;
  height: 100vh;
  overflow: hidden;
}

/* ── Scoreboard ── */
#score-board {
  display: flex;
  width: 100%;
  gap: 20px;
  margin-bottom: 14px;
}

.player-icon {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.player-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.player-card.active {
  border-color: #fbbf24;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.45);
  transform: scale(1.03);
}

.p-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #cbd5e1;
}

.p-score {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  min-width: 60px;
  text-align: right;
}

/* ── Question Modal ── */
#question-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(10px);
  z-index: 900;
  align-items: center;
  justify-content: center;
}

#question-modal.open {
  display: flex;
}

.qmodal-inner {
  background: #1e293b;
  border: 3px solid transparent;
  border-radius: 20px;
  padding: 44px 50px;
  max-width: 620px;
  width: 92%;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  transition: border-color 0.25s, box-shadow 0.25s;
}

/* Player 1 — blue */
.qmodal-inner.qmodal-p1 {
  border-color: #3b82f6;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 30px 60px rgba(0, 0, 0, 0.6);
}

/* Player 2 — red */
.qmodal-inner.qmodal-p2 {
  border-color: #ef4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.5), 0 30px 60px rgba(0, 0, 0, 0.6);
}

#q-player-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

#q-points-label {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 24px;
}

#q-text {
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 28px;
  line-height: 1.4;
}

#q-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.q-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 14px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.2s, transform 0.15s;
}

.q-btn:hover:not(:disabled) {
  background: #fbbf24;
  color: #1e293b;
  transform: translateY(-2px);
}

.q-btn:disabled {
  cursor: default;
  opacity: 0.85;
  transform: none;
  background: rgba(255, 255, 255, 0.06);
}

.q-btn.correct {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
  opacity: 1 !important;
}

.q-btn.wrong {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
  opacity: 1 !important;
}

#wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  width: 100%;
}

#board-img {
  width: 100%;
  max-width: 1200px;
  height: auto;
  border-radius: 12px;
  display: block;
  pointer-events: none;
}

canvas {
  display: block;
  cursor: default;
  border-radius: 12px;
  width: 100%;
  /* Forces canvas to fit parent container width */
  max-width: 1200px;
  /* Caps at the max resolution we draw inside JS */
  height: 100%;
  /* Keeps aspect ratio */
  background-color: transparent;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Glassmorphism for Overlay window */
#overlay {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 16px;
  padding: 40px 50px;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
  width: 80%;
  max-width: 450px;
}

#overlay button {
  margin-top: 30px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border: none;
  border-radius: 8px;
  padding: 16px 40px;
  font-size: 18px;
  color: #1e293b;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#overlay button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.6);
}

#overlay button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(245, 158, 11, 0.4);
}

/* Responsive adjustments for phones and small tablets */
/* ── Responsive Breakpoints ── */

/* Tablet: narrow side panels */
@media (max-width: 1100px) {

  #left-panel,
  #right-panel {
    flex: 0 0 110px;
  }

  .p-score {
    font-size: 28px;
  }

  .p-label {
    font-size: 13px;
  }

  .player-icon {
    width: 42px;
    height: 42px;
  }
}

/* Small tablet / large phone landscape */
@media (max-width: 820px) {

  #left-panel,
  #right-panel {
    flex: 0 0 60px;
  }

  #score-board {
    gap: 10px;
    margin-bottom: 8px;
  }

  .player-card {
    padding: 8px 12px;
  }

  .p-score {
    font-size: 22px;
  }

  .p-label {
    font-size: 11px;
    letter-spacing: 0;
  }

  .player-icon {
    width: 30px;
    height: 30px;
  }

  .qmodal-inner {
    padding: 28px 20px;
  }

  #q-text {
    font-size: 17px;
  }

  .q-btn {
    font-size: 13px;
    padding: 10px 8px;
  }
}

/* Phone landscape — hide side panels entirely */
@media (max-width: 600px) and (orientation: landscape) {

  #left-panel,
  #right-panel {
    display: none;
  }

  #game-container {
    padding: 4px;
  }

  .player-card {
    padding: 6px 10px;
  }

  .p-score {
    font-size: 18px;
  }
}

/* ── Rotate Warning (portrait mobile) ── */
#rotate-warning {
  display: none;
  position: fixed;
  inset: 0;
  background: #1a3d15;
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 40px;
}

#rotate-warning .rotate-icon {
  font-size: 80px;
  animation: rotateAnim 1.5s ease-in-out infinite alternate;
}

@keyframes rotateAnim {
  from {
    transform: rotate(-30deg);
  }

  to {
    transform: rotate(30deg);
  }
}

#rotate-warning p {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  max-width: 280px;
  line-height: 1.5;
}

/* Show warning on portrait mode phones */
@media (max-width: 768px) and (orientation: portrait) {
  #rotate-warning {
    display: flex;
  }
}