/* ===========================
   Live Event Styles
   =========================== */

/* --- Buttons --- */
.lh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.2s, transform 0.2s;
}

.lh-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  text-decoration: none;
}

/* Primary: accent color filled */
.lh-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.lh-btn-primary:hover { color: #fff; }

/* Large variant */
.lh-btn-lg {
  padding: 0.65rem 1.75rem;
  font-size: 1rem;
}

/* Secondary: outlined */
.lh-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.lh-btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Small variant */
.lh-btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Filter button group */
.lh-filter-group {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.lh-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.lh-filter-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.lh-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Badges --- */
.lh-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.lh-badge-warning {
  background: rgba(255, 193, 7, 0.15);
  color: #d4a017;
}
.lh-badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
.lh-badge-secondary {
  background: rgba(128, 128, 128, 0.15);
  color: var(--text-secondary);
}
.lh-badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.lh-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* --- Event Header (show page) --- */
.lh-event-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.lh-event-header-main {
  flex: 1;
  min-width: 0;
}
.lh-event-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}
.lh-event-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.lh-event-meta {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lh-event-comment {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #aaa);
}

/* Action column (countdown + join) */
.lh-event-header-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Countdown */
.lh-countdown {
  text-align: center;
  padding: 0.5rem 1rem;
  background: rgba(var(--accent-rgb, 139,26,26), 0.08);
  border: 1px solid rgba(var(--accent-rgb, 139,26,26), 0.2);
  border-radius: 10px;
  min-width: 140px;
}
.lh-countdown-label {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin-bottom: 0.25rem;
}
.lh-countdown-time {
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #eee);
  letter-spacing: 1px;
}
.lh-countdown-urgent .lh-countdown-time {
  color: #dc3545;
  animation: lh-countdown-blink 1s ease-in-out infinite;
}
.lh-countdown-ended {
  opacity: 0.6;
}
@keyframes lh-countdown-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Join button */
.lh-join-btn {
  width: 100%;
  justify-content: center;
  font-size: 1.05rem;
  padding: 0.7rem 2rem;
}

/* Info cards (challenge, reward) */
.lh-info-card {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.lh-info-card h4 {
  margin: 0 0 0.375rem;
  font-size: 0.95rem;
}
.lh-info-card-challenge {
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.25);
}
.lh-info-card-challenge h4 i { color: #ffc107; }
.lh-info-card-reward {
  background: rgba(40, 167, 69, 0.08);
  border: 1px solid rgba(40, 167, 69, 0.25);
}
.lh-info-card-reward h4 i { color: #28a745; }

@media (max-width: 600px) {
  .lh-event-header {
    flex-direction: column;
  }
  .lh-event-header-action {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }
  .lh-join-btn {
    flex: 1;
  }
}

/* --- Event Card (used in index list by JS) --- */
.lh-event-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius, 0.75rem);
  padding: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.lh-event-card:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: inherit;
}

/* --- Create Form Panel --- */
.lh-create-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius, 0.75rem);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.lh-create-panel label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.lh-create-panel select,
.lh-create-panel input[type="text"],
.lh-create-panel input[type="number"],
.lh-create-panel textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--body-bg, #fff);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.lh-create-panel select:focus,
.lh-create-panel input:focus,
.lh-create-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

/* --- Close button (X) --- */
.lh-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}
.lh-close-btn:hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text-primary);
}

/* --- Back Link --- */
.lh-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s;
}
.lh-back-link:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  text-decoration: none;
}

/* ===========================
   Reaction Shop
   =========================== */

.lh-reaction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.lh-reaction-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.25);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #d4a017;
}
.lh-reaction-balance i { font-size: 0.9rem; }

.lh-reaction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.625rem;
}

.lh-reaction-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border-color, #333);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.lh-reaction-card:hover {
  border-color: rgba(var(--accent-rgb, 139,26,26), 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.lh-reaction-card:active {
  transform: translateY(0);
}

.lh-reaction-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.lh-reaction-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary, #eee);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.lh-reaction-card-price {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #d4a017;
  background: rgba(255, 193, 7, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}
.lh-reaction-card-price i { font-size: 0.65rem; }

/* ===========================
   Purchase Confirmation Modal
   =========================== */

.lh-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.lh-modal-overlay.lh-modal-visible {
  opacity: 1;
}

.lh-modal-panel {
  background: var(--card-bg, #1e1e2e);
  border: 1px solid var(--border-color, #333);
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.lh-modal-body {
  padding: 1.5rem;
}

/* Item preview area */
.lh-modal-item-preview {
  text-align: center;
  padding: 1.25rem 1rem;
  margin: -1.5rem -1.5rem 1.25rem;
  background: linear-gradient(
    135deg,
    rgba(var(--accent-rgb, 139,26,26), 0.08) 0%,
    rgba(var(--accent-rgb, 139,26,26), 0.02) 100%
  );
  border-bottom: 1px solid var(--border-color, #333);
}
.lh-modal-item-icon {
  font-size: 2.5rem;
  color: var(--item-color, var(--accent));
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}
.lh-modal-item-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #eee);
}
.lh-modal-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #888);
  margin-top: 0.25rem;
}

/* Cost breakdown */
.lh-modal-cost-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color, #333);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
}
.lh-modal-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary, #aaa);
}
.lh-modal-cost-value {
  font-weight: 700;
  color: #d4a017;
  font-size: 0.95rem;
}
.lh-modal-cost-divider {
  height: 1px;
  background: var(--border-color, #333);
  margin: 0.35rem 0;
}
.lh-modal-cost-error {
  color: #dc3545;
  font-weight: 600;
  justify-content: center;
}

/* Action buttons */
.lh-modal-actions {
  display: flex;
  gap: 0.5rem;
}
.lh-modal-actions .lh-btn {
  flex: 1;
  justify-content: center;
}
.lh-modal-actions .lh-btn-primary {
  padding: 0.6rem 1rem;
}
.lh-modal-actions .lh-btn-secondary {
  padding: 0.6rem 1rem;
}

@media (max-width: 480px) {
  .lh-reaction-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
  }
  .lh-reaction-card {
    padding: 0.6rem 0.4rem;
  }
  .lh-reaction-card-icon {
    font-size: 1.25rem;
  }
  .lh-modal-panel {
    width: 95%;
  }
}

/* ===========================
   Venue Visual
   =========================== */

.venue-visual {
  --venue-bg: #1a1a2e;
  --venue-accent: #ffc107;
  --venue-stage: #2d2d44;
  --venue-accent-rgb: 255, 193, 7;
  position: relative;
  background: var(--venue-bg);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* --- Stage --- */
.venue-stage {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.venue-stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.3) saturate(0.7);
}

.venue-stage-bg-fallback {
  position: absolute;
  inset: 0;
  background: var(--venue-stage);
}

.venue-stage-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    var(--venue-bg) 100%
  );
}

/* Stage lights */
.venue-stage-light {
  position: absolute;
  top: 0;
  width: 35%;
  height: 100%;
  opacity: 0.2;
  pointer-events: none;
}
.venue-stage-light-l {
  left: 0;
  background: linear-gradient(135deg, var(--venue-accent), transparent 65%);
}
.venue-stage-light-r {
  right: 0;
  background: linear-gradient(225deg, var(--venue-accent), transparent 65%);
}

/* Stage content */
.venue-stage-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  z-index: 1;
}

.venue-stage-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--venue-accent);
  font-weight: 700;
}

.venue-stage-song {
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
  margin-top: 0.25rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.venue-stage-song i {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-right: 0.25rem;
}

/* --- Decorations Overlay --- */
.venue-decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.venue-decorations:empty {
  display: none;
}

/* Custom icon definitions moved to theme.css (shared with admin) */

/* --- Venue decoration overlays (icon-based, matches button icons) --- */
.venue-deco-penlight {
  position: absolute;
  font-size: 0.75rem;
  filter: drop-shadow(0 0 5px var(--deco-color, #ff6b6b));
  animation: venue-deco-pulse var(--deco-dur, 2s) ease-in-out infinite;
  animation-delay: var(--deco-delay, 0s);
}
.venue-deco-uchiwa {
  position: absolute;
  font-size: 0.75rem;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
  opacity: 0.85;
  animation: venue-deco-sway var(--deco-dur, 3s) ease-in-out infinite;
  animation-delay: var(--deco-delay, 0s);
}
.venue-deco-flower {
  position: absolute;
  font-size: 0.8rem;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
  opacity: 0.8;
  animation: venue-deco-sway var(--deco-dur, 4s) ease-in-out infinite;
  animation-delay: var(--deco-delay, 0s);
}

/* Effect: sparkle star */
.venue-deco-effect {
  position: absolute;
  font-size: 0.7rem;
  filter: drop-shadow(0 0 4px currentColor);
  animation: venue-deco-sparkle var(--deco-dur, 2.5s) ease-in-out infinite;
  animation-delay: var(--deco-delay, 0s);
}

/* Limited: gem */
.venue-deco-limited {
  position: absolute;
  font-size: 0.85rem;
  filter: drop-shadow(0 0 6px currentColor);
  animation: venue-deco-float var(--deco-dur, 3s) ease-in-out infinite;
  animation-delay: var(--deco-delay, 0s);
}

/* Decoration animations */
@keyframes venue-deco-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.95; }
}

@keyframes venue-deco-sway {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

@keyframes venue-deco-sparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.3); }
}

@keyframes venue-deco-float {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-6px); opacity: 1; }
}

/* --- Audience --- */
.venue-audience {
  padding: 1rem;
  min-height: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  align-content: center;
}

.venue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.85rem;
  padding: 1rem;
}
.venue-empty i {
  font-size: 1.5rem;
  opacity: 0.4;
}

/* --- Person Avatar --- */
.venue-person {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 2px solid transparent;
  flex-shrink: 0;
}
.venue-person-gold  { border-color: #ffd700; box-shadow: 0 0 6px rgba(255, 215, 0, 0.4); }
.venue-person-silver { border-color: #c0c0c0; box-shadow: 0 0 6px rgba(192, 192, 192, 0.3); }
.venue-person-bronze { border-color: #cd7f32; box-shadow: 0 0 6px rgba(205, 127, 50, 0.3); }

.venue-person-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.venue-person-default {
  width: 100%;
  height: 100%;
  background: #555;
}

.venue-person-medal {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 0.6rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.venue-person-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(var(--venue-accent-rgb), 0.35);
}

/* --- Top 3 Row --- */
.venue-top3 {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* --- Dots --- */
.venue-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.venue-dots-more {
  font-size: 0.7rem;
  color: var(--venue-accent);
  padding: 0.125rem 0.375rem;
}

/* --- Progress Bar --- */
.venue-progress {
  width: 100%;
  margin-top: 0.375rem;
}
.venue-progress-track {
  height: 10px;
  background: rgba(var(--venue-accent-rgb), 0.12);
  border-radius: 5px;
  overflow: hidden;
}
.venue-progress-fill {
  height: 100%;
  background: var(--venue-accent);
  border-radius: 5px;
  transition: width 0.5s;
}
.venue-progress-label {
  font-size: 0.75rem;
  color: var(--venue-accent);
  text-align: center;
  margin-top: 0.375rem;
}

/* --- Area Grid (Tier 5-6) --- */
.venue-area-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
}
.venue-area-block {
  background: var(--venue-accent);
  border-radius: 4px;
  padding: 0.5rem;
  text-align: center;
}
.venue-area-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.7);
}
.venue-area-pct {
  font-size: 0.85rem;
  color: #fff;
  font-weight: bold;
}

/* --- Overview (Tier 7-8) --- */
.venue-overview {
  width: 100%;
  height: 80px;
  border-radius: 8px;
  background: rgba(var(--venue-accent-rgb), 0.08);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.venue-overview-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, var(--venue-accent), transparent);
  opacity: 0.3;
  transition: height 0.5s;
}
.venue-overview-pct {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

/* --- Recruit Gauge --- */
.venue-recruit {
  margin-top: 0.75rem;
  padding: 0 0.5rem;
}
.venue-recruit-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 0.25rem;
}
.venue-recruit-track {
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}
.venue-recruit-fill {
  height: 100%;
  background: #ffc107;
  border-radius: 3px;
  transition: width 0.5s;
}
.venue-recruit-success {
  background: #28a745;
}
.venue-recruit-msg {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  text-align: center;
}
.venue-recruit-msg-warn { color: #ffc107; }
.venue-recruit-msg-ok   { color: #28a745; }
.venue-recruit-msg-fail { color: #dc3545; }

/* --- Settled --- */
.venue-settled-msg {
  text-align: center;
  margin-top: 0.75rem;
  padding: 0 0.5rem;
  font-size: 0.85rem;
  color: var(--venue-accent);
}

/* --- Venue responsive --- */
@media (max-width: 480px) {
  .venue-stage {
    height: 120px;
  }
  .venue-stage-content {
    padding: 0.75rem 1rem;
  }
  .venue-stage-song {
    font-size: 0.9rem;
  }
  .venue-person {
    width: 28px;
    height: 28px;
  }
}
