/* LG Subscribe Game Design System */

@font-face {
  font-family: 'DB Heavent';
  src: url('/resources/DB Heavent v3.2.1.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --primary-red: #c40028;
  --bright-red: #ff1a40;
  --dark-bg: #3b0009;
  --darker-bg: #220005;
  --glass-bg: rgba(60, 0, 12, 0.75);
  --glass-border: rgba(255, 60, 90, 0.35);
  --text-gold: #ffde7a;
  --text-white: #ffffff;
  --font-main: 'DB Heavent', 'Sukhumvit Set', 'Prompt', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--darker-bg);
  background-image: radial-gradient(circle at center, #660015 0%, #300008 70%, #170003 100%), url('/resources/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-white);
  font-size: 24px;
  overflow-x: hidden;
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: var(--font-main) !important;
}

/* ==========================================================================
   LED 16:9 Display Layout (1920x1080 aspect fit)
   ========================================================================== */
.led-container {
  width: 1920px;
  height: 1080px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 60px;
  background: radial-gradient(circle at center, rgba(120, 0, 25, 0.85) 0%, rgba(35, 0, 7, 0.95) 100%), url('/resources/theme.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

/* LED Header */
.led-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 15px;
}

.led-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.led-brand img {
  height: 55px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.led-title-group {
  display: flex;
  flex-direction: column;
}

.led-main-title {
  font-size: 44px;
  font-weight: bold;
  letter-spacing: 1px;
  text-shadow: 0 0 15px rgba(255, 50, 80, 0.8);
}

.led-sub-title {
  font-size: 28px;
  color: #ff99aa;
  margin-top: -5px;
}

.question-badge {
  background: linear-gradient(135deg, #d60029, #800018);
  border: 2px solid #ff4d6d;
  padding: 8px 30px;
  border-radius: 30px;
  font-size: 32px;
  font-weight: bold;
  box-shadow: 0 0 20px rgba(214, 0, 41, 0.6);
}

/* LED Content Area */
.led-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  position: relative;
}

/* Step 1: QR Code View */
.qr-stage-card {
  background: var(--glass-bg);
  border: 3px solid var(--glass-border);
  border-radius: 30px;
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(15px);
  box-shadow: 0 0 40px rgba(230, 0, 45, 0.4);
  animation: pulse-glow 3s infinite alternate;
}

.qr-box {
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
  margin: 20px 0;
}

.qr-box img {
  width: 320px;
  height: 320px;
  display: block;
}

.qr-instruction {
  font-size: 36px;
  font-weight: bold;
  color: #ffffff;
  margin-top: 10px;
}

/* Step 2-6: Live Bar Chart View */
.chart-container {
  width: 100%;
  max-width: 1600px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.question-heading {
  font-size: 50px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 25px;
  background: rgba(30, 0, 7, 0.6);
  border: 2px solid rgba(255, 100, 120, 0.2);
  border-radius: 16px;
  padding: 12px 25px;
  backdrop-filter: blur(8px);
}

.bar-label {
  width: 320px;
  font-size: 34px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track-wrapper {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  height: 48px;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b30024 0%, #ff1a44 70%, #ff6680 100%);
  border-radius: 24px;
  transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 0 15px rgba(255, 26, 68, 0.8);
}

.bar-percent {
  width: 100px;
  font-size: 38px;
  font-weight: bold;
  text-align: right;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* LED Footer */
.led-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  padding-top: 15px;
  font-size: 32px;
}

.voter-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Summary Screen (Step 7) */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1750px;
}

.summary-col {
  background: rgba(50, 0, 10, 0.75);
  border: 2px solid rgba(255, 80, 100, 0.4);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(10px);
}

.summary-q-title {
  font-size: 28px;
  font-weight: bold;
  color: #ff99aa;
  margin-bottom: 15px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-answer-card {
  background: linear-gradient(180deg, rgba(200, 0, 40, 0.8), rgba(90, 0, 18, 0.9));
  border: 2px solid #ff3355;
  border-radius: 16px;
  padding: 25px 15px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 20px rgba(255, 0, 50, 0.3);
}

.summary-ans-text {
  font-size: 34px;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 15px;
}

.summary-ans-pct {
  font-size: 48px;
  font-weight: bold;
  color: var(--text-gold);
  text-shadow: 0 0 10px rgba(255, 222, 122, 0.6);
}

/* Winners Screens (Step 8 & 9) */
.winners-section-title {
  font-size: 52px;
  font-weight: bold;
  text-align: center;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 30, 70, 0.8);
  margin-bottom: 25px;
}

.winners-grid-20 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1750px;
}

.winners-grid-10 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 25px;
  width: 100%;
  max-width: 1750px;
}

.winner-card {
  background: linear-gradient(135deg, rgba(160, 0, 32, 0.85), rgba(70, 0, 14, 0.9));
  border: 2px solid rgba(255, 120, 140, 0.5);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.4s ease-out;
}

.winner-rank-badge {
  width: 44px;
  height: 44px;
  background: var(--text-gold);
  color: #40000a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(255, 222, 122, 0.8);
}

.winner-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.winner-name {
  font-size: 30px;
  font-weight: bold;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winner-code {
  font-size: 24px;
  color: #ffb3c1;
}

/* ==========================================================================
   Mobile Player Responsive View
   ========================================================================== */
.player-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #50000d 0%, #200005 100%);
  padding: 20px;
}

.player-header {
  text-align: center;
  padding: 10px 0 12px;
}

.player-header img {
  max-height: 32px;
  max-width: 75%;
  width: auto;
  object-fit: contain;
}

.player-card {
  background: rgba(45, 0, 9, 0.85);
  border: 2px solid rgba(255, 70, 95, 0.35);
  border-radius: 24px;
  padding: 25px 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 22px;
  color: #ffb3c1;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 100, 120, 0.4);
  background: rgba(15, 0, 3, 0.7);
  color: #ffffff;
  font-family: inherit;
  font-size: 22px;
  outline: none;
  transition: border-color 0.3s;
}

.form-input:focus {
  border-color: #ff3355;
  box-shadow: 0 0 12px rgba(255, 51, 85, 0.5);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #e6002e, #99001f);
  color: white;
  font-family: inherit;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(230, 0, 46, 0.5);
  transition: transform 0.1s, box-shadow 0.2s;
  margin-top: 10px;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(230, 0, 46, 0.3);
}

/* Mobile Step Wizard */
.step-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
}

.dot.active {
  background: #ff3355;
  transform: scale(1.3);
  box-shadow: 0 0 10px #ff3355;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(20, 0, 4, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 18px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-card.selected {
  background: linear-gradient(90deg, rgba(200, 0, 40, 0.8), rgba(90, 0, 18, 0.8));
  border-color: #ff3355;
  box-shadow: 0 0 15px rgba(255, 51, 85, 0.4);
}

.option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ff99aa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-card.selected .option-radio::after {
  content: '';
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
}

.option-text {
  font-size: 24px;
  color: #ffffff;
}

/* Waiting / Status Screens */
.waiting-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  flex: 1;
}

.hourglass-icon {
  font-size: 80px;
  animation: spin-hourglass 4s infinite ease-in-out;
  margin-bottom: 25px;
}

.checkmark-icon {
  width: 90px;
  height: 90px;
  background: #ff1a40;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  color: white;
  margin-bottom: 25px;
  box-shadow: 0 0 30px rgba(255, 26, 64, 0.6);
}

/* Animations */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 25px rgba(230, 0, 45, 0.3); }
  100% { box-shadow: 0 0 55px rgba(255, 51, 85, 0.7); }
}

@keyframes spin-hourglass {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Staff Controller View
   ========================================================================== */
.controller-wrapper {
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
}

.ctrl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(40, 0, 8, 0.9);
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 51, 85, 0.4);
  margin-bottom: 25px;
}

.ctrl-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.step-btn {
  background: rgba(30, 0, 6, 0.8);
  border: 2px solid rgba(255, 80, 100, 0.3);
  border-radius: 16px;
  padding: 18px;
  color: white;
  font-family: inherit;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: all 0.2s;
}

.step-btn:hover {
  background: rgba(80, 0, 16, 0.9);
  border-color: #ff3355;
}

.step-btn.active {
  background: linear-gradient(135deg, #d60029, #700014);
  border-color: #ffde7a;
  box-shadow: 0 0 20px rgba(214, 0, 41, 0.7);
}

.step-num {
  font-size: 18px;
  color: #ff99aa;
  font-weight: bold;
}

.step-title {
  font-size: 26px;
  font-weight: bold;
  margin-top: 4px;
}

/* Controller Action Toolbar */
.action-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  background: rgba(30, 0, 6, 0.85);
  padding: 16px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 80, 100, 0.3);
  margin-bottom: 25px;
}

.ctrl-btn-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-ctrl {
  height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 20px;
  font-weight: bold;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-ctrl:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.btn-ctrl:active {
  transform: translateY(0);
}

.btn-ctrl-prev {
  background: linear-gradient(135deg, #c40028, #7a0018);
  color: #ffffff;
}

.btn-ctrl-next {
  background: linear-gradient(135deg, #00b34a, #00662a);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 179, 74, 0.4);
}

.btn-ctrl-led {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-ctrl-reset {
  background: linear-gradient(135deg, #990017, #55000d);
  border: 1px solid #ff3355;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 51, 85, 0.3);
}

.btn-ctrl-hard {
  background: rgba(20, 0, 4, 0.7);
  border: 1px solid rgba(255, 100, 120, 0.4);
  color: #ff99aa;
}

.btn-ctrl-hard:hover {
  background: rgba(100, 0, 20, 0.8);
  color: #ffffff;
  border-color: #ff3355;
}

/* Custom Modal Buttons */
.btn-modal-cancel {
  width: 45%;
  height: 48px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-family: var(--font-main) !important;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
}

.btn-modal-confirm {
  width: 50%;
  height: 48px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(135deg, #e6002e, #99001f);
  color: #ffffff;
  font-family: var(--font-main) !important;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(230, 0, 46, 0.5);
  transition: all 0.2s ease;
}

.btn-modal-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 0, 46, 0.7);
}

