/* ========================================= */
/* TRUTH GAME CSS PATCH */
/* Mockup-derived: Metallic Dark + LED Side Bars + */
/* LED Dot-Matrix Indicators + 3D Glow O/X Buttons + */
/* Pulse Animations */
/* ========================================= */

/* --- CSS Variables (scoped to #truthGame) --- */
#truthGame {
  --metal-dark: #1a1a1d;
  --metal-light: #2d2d32;
  --led-green: #00ff41;
  --led-red: #ff073a;
  --gold: #ffd700;
}

/* ===== Layout (from mockup #truth) ===== */
#truthGame {
  padding: 12px 16px;
  gap: 10px;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(77, 77, 82, 0.4), transparent 60%),
    linear-gradient(135deg, var(--metal-dark) 0%, var(--metal-light) 50%, var(--metal-dark) 100%);
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

/* Brushed-metal grid overlay (from mockup #truth::before) */
#truthGame::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,0.02) 1px, rgba(255,255,255,0.02) 2px),
    repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.02) 1px, rgba(255,255,255,0.02) 2px);
  pointer-events: none;
  z-index: 0;
}

#truthGame > * { position: relative; z-index: 1; }

/* ===== Top Bar ===== */
.truth-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background:
    linear-gradient(180deg, rgba(35,35,45,0.95) 0%, rgba(25,25,32,0.95) 100%);
  border-radius: 8px;
  border: 1px solid rgba(120,120,140,0.15);
  border-top: 1px solid rgba(180,180,200,0.1);
  box-shadow:
    0 2px 8px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.truth-round-badge {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 15px;
  color: var(--led-green);
  letter-spacing: 3px;
  text-shadow:
    0 0 8px var(--led-green),
    0 0 20px rgba(0,255,65,0.15);
  text-transform: uppercase;
}

.truth-questioner-display {
  font-size: 13px;
  font-weight: 700;
  color: #8888a0;
  letter-spacing: 0.5px;
}

/* ===== Main Content ===== */
.truth-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0;
  gap: 40px;
}

.truth-phase-area {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: truthFadeIn 0.4s ease;
}

@keyframes truthFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Question Input (Questioner) ===== */
.truth-your-turn-badge {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 22px;
  color: var(--led-green);
  text-align: center;
  text-shadow:
    0 0 12px var(--led-green),
    0 0 30px rgba(0,255,65,0.2);
  letter-spacing: 1px;
}

.truth-question-box {
  width: 100%;
  position: relative;
}

.truth-textarea {
  width: 100%;
  padding: 16px;
  background: linear-gradient(180deg, #141418 0%, #18181e 100%);
  border: 2px solid rgba(120,120,140,0.2);
  border-radius: 8px;
  color: #d0d0e0;
  font-size: 16px;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  line-height: 1.5;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.truth-textarea:focus {
  border-color: rgba(0,255,65,0.5);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.3),
    0 0 16px rgba(0,255,65,0.12);
}

.truth-textarea::placeholder {
  color: #555568;
  font-size: 14px;
}

.truth-char-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 11px;
  color: #555568;
}

.truth-submit-btn {
  max-width: 100%;
}

/* ===== Waiting Screen ===== */
.truth-waiting-icon {
  font-size: 64px;
  animation: float 3s ease-in-out infinite;
}

.truth-waiting-text {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 22px;
  color: #d0d0e0;
}

.truth-waiting-sub {
  font-size: 14px;
  color: #666680;
  text-align: center;
}

.truth-dots-loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.truth-dots-loader span {
  width: 10px;
  height: 10px;
  background: var(--led-green);
  border-radius: 50%;
  animation: truthDotPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 6px var(--led-green);
}

.truth-dots-loader span:nth-child(2) { animation-delay: 0.2s; }
.truth-dots-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes truthDotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ===== Question Display (from mockup .question-display) ===== */
.truth-question-display {
  width: 100%;
  padding: 32px 24px;
  background:
    linear-gradient(135deg, rgba(45, 45, 50, 0.9), rgba(35, 35, 40, 0.9));
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 12px 32px rgba(0,0,0,0.6),
    inset 0 0 30px rgba(255, 255, 255, 0.02);
}

/* LED strip accent top */
.truth-question-display::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--led-green) 0px, var(--led-green) 4px,
      transparent 4px, transparent 8px
    );
  box-shadow: 0 0 8px var(--led-green), 0 0 20px rgba(0,255,65,0.15);
}

.truth-question-display-small {
  padding: 14px;
}

.truth-question-display-small .truth-question-text {
  font-size: 16px;
}

.truth-question-label {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 28px;
  color: var(--led-green);
  margin-bottom: 8px;
  text-shadow:
    0 0 10px var(--led-green),
    0 0 30px rgba(0,255,65,0.2);
  letter-spacing: 4px;
}

.truth-question-display-small .truth-question-label {
  font-size: 20px;
  margin-bottom: 4px;
}

.truth-question-text {
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.5;
  word-break: keep-all;
  color: #fff;
  letter-spacing: -0.5px;
}

/* ===== O/X Vote Buttons - 3D Glow (from mockup) ===== */
.truth-vote-buttons {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: center;
  padding: 10px 0;
}

.truth-vote-btn {
  width: 140px;
  height: 140px;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.truth-vote-btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.truth-vote-btn:active::before {
  width: 200px;
  height: 200px;
}

.truth-vote-btn:hover {
  transform: translateY(-4px) scale(1.05);
}

.truth-vote-btn:active {
  transform: translateY(2px) scale(0.98);
}

/* O Button - Circle Green Glow (from mockup .btn-vote-o) */
.truth-vote-o {
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #00ff41, #00b833),
    linear-gradient(135deg, #00ff41, #00a030);
  color: #0a0a0a;
  box-shadow:
    0 12px 32px rgba(0, 255, 65, 0.4),
    inset 0 4px 8px rgba(255,255,255,0.3),
    inset 0 -4px 8px rgba(0,0,0,0.2);
  border: 2px solid rgba(0,255,65,0.25);
}

.truth-vote-o::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  pointer-events: none;
}

.truth-vote-o:hover {
  box-shadow:
    0 16px 40px rgba(0, 255, 65, 0.6),
    inset 0 4px 8px rgba(255,255,255,0.3),
    inset 0 -4px 8px rgba(0,0,0,0.2);
}

/* X Button - Rounded Square Red Glow (from mockup .btn-vote-x) */
.truth-vote-x {
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, #ff073a, #cc0029),
    linear-gradient(135deg, #ff073a, #a00020);
  color: #0a0a0a;
  box-shadow:
    0 12px 32px rgba(255, 7, 58, 0.4),
    inset 0 4px 8px rgba(255,255,255,0.3),
    inset 0 -4px 8px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,60,80,0.25);
}

.truth-vote-x::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  border: 3px solid rgba(255,255,255,0.3);
  pointer-events: none;
}

.truth-vote-x:hover {
  box-shadow:
    0 16px 40px rgba(255, 7, 58, 0.6),
    inset 0 4px 8px rgba(255,255,255,0.3),
    inset 0 -4px 8px rgba(0,0,0,0.2);
}

.truth-vote-symbol {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 60px;
  color: #0a0a0a;
  text-shadow:
    0 0 12px rgba(255,255,255,0.4),
    0 2px 8px rgba(0,0,0,0.3);
  line-height: 1;
}

.truth-vote-label {
  font-size: 14px;
  font-weight: 700;
  color: rgba(10,10,10,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.truth-vote-btn.selected {
  animation: truthBtnPulse 0.5s ease;
}

.truth-vote-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(0.5);
}

@keyframes truthBtnPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.15); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ===== Vote Waiting ===== */
.truth-vote-waiting {
  width: 100%;
  text-align: center;
}

.truth-voted-badge {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 20px;
  color: var(--led-green);
  margin-bottom: 16px;
  text-shadow: 0 0 12px var(--led-green);
}

.truth-vote-progress {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.truth-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(60,60,80,0.6);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(120,120,140,0.1);
}

.truth-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--led-green), #00b833);
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--led-green);
}

.truth-progress-text {
  font-size: 14px;
  color: #8888a0;
  font-weight: 700;
}

/* ===== Result Area (from mockup .result-panel) ===== */
.truth-result-container {
  width: 100%;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(20, 20, 25, 0.9), rgba(30, 30, 35, 0.9));
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow:
    0 12px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 0 20px rgba(0,255,65,0.05);
  position: relative;
}

/* LED side bars (from mockup .result-panel::before/after) */
.truth-result-container::before,
.truth-result-container::after {
  content: '';
  position: absolute;
  width: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  background: linear-gradient(180deg, transparent, var(--led-green), transparent);
  box-shadow: 0 0 10px var(--led-green);
  animation: truthPulse 2s ease-in-out infinite;
}

.truth-result-container::before {
  left: -8px;
}

.truth-result-container::after {
  right: -8px;
}

@keyframes truthPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.truth-result-title {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 18px;
  color: #8888a0;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.truth-result-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  border: 1px solid rgba(120,120,140,0.08);
}

/* LED-style result icons */
.truth-result-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Black Han Sans', sans-serif;
  font-size: 28px;
  color: white;
  flex-shrink: 0;
  text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.truth-result-icon-o {
  background: radial-gradient(circle at 30% 30%, var(--led-green), #00b833);
  box-shadow:
    0 0 10px var(--led-green),
    inset 0 0 5px rgba(255,255,255,0.5);
}

.truth-result-icon-x {
  background: radial-gradient(circle at 30% 30%, var(--led-red), #cc0029);
  box-shadow:
    0 0 10px var(--led-red),
    inset 0 0 5px rgba(255,255,255,0.5);
}

.truth-result-info {
  flex: 1;
}

.truth-result-count {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 28px;
  color: #e0e0f0;
  margin-bottom: 6px;
}

.truth-result-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* LED glow dots (from mockup .led-indicator) */
.truth-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.truth-dot.filled-o {
  background: radial-gradient(circle at 30% 30%, var(--led-green), #00b833);
  box-shadow:
    0 0 10px var(--led-green),
    inset 0 0 5px rgba(255,255,255,0.5);
  border: 2px solid var(--led-green);
  animation: truthDotAppear 0.4s ease backwards;
}

.truth-dot.filled-x {
  background: radial-gradient(circle at 30% 30%, var(--led-red), #cc0029);
  box-shadow:
    0 0 10px var(--led-red),
    inset 0 0 5px rgba(255,255,255,0.5);
  border: 2px solid var(--led-red);
  animation: truthDotAppear 0.4s ease backwards;
}

.truth-dot.empty {
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent);
  border: 2px solid rgba(255,255,255,0.1);
}

@keyframes truthDotAppear {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.truth-result-total {
  text-align: center;
  font-size: 13px;
  color: #666680;
  margin-top: 4px;
  font-weight: 700;
}

/* ===== Next Round ===== */
.truth-next-btn {
  max-width: 100%;
}

.truth-next-waiting {
  font-size: 14px;
  color: #666680;
  text-align: center;
  font-weight: 700;
}

/* ===== Bottom Player Bar ===== */
.truth-players-bar {
  display: flex;
  gap: 8px;
  padding: 10px 8px;
  background:
    linear-gradient(180deg, rgba(30,30,38,0.9) 0%, rgba(22,22,28,0.9) 100%);
  border-radius: 8px;
  border: 1px solid rgba(120,120,140,0.1);
  border-top: 1px solid rgba(180,180,200,0.05);
  overflow-x: auto;
  flex-shrink: 0;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.truth-player-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 48px;
  flex-shrink: 0;
}

.truth-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  transition: all 0.3s;
  border: 2px solid rgba(120,120,140,0.15);
}

.truth-player-avatar.is-questioner {
  box-shadow:
    0 0 0 3px rgba(0,255,65,0.4),
    0 0 16px rgba(0,255,65,0.3);
  border-color: var(--led-green);
}

.truth-player-avatar.has-voted::after {
  content: '\2713';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--led-green);
  border-radius: 50%;
  font-size: 9px;
  color: #0a0a0e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 0 6px var(--led-green);
}

.truth-player-name {
  font-size: 10px;
  font-weight: 700;
  max-width: 52px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  color: #8888a0;
}

.truth-player-name.active-name {
  color: var(--led-green);
  text-shadow: 0 0 6px var(--led-green);
}

