/* ==========================================================================
   各抽籤模式專屬視覺特效與動畫 (Wheel, Slot, Matrix, Group, Topic)
   ========================================================================== */

/* --------------------------------------------------------------------------
   模式切換子選單 (Subtabs)
   -------------------------------------------------------------------------- */
.subtabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.subtab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.subtab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.subtab-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

/* --------------------------------------------------------------------------
   全班抽籤 - 幸運大轉盤 (Lucky Wheel)
   -------------------------------------------------------------------------- */
.wheel-stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  min-height: 520px;
}

.wheel-outer-wrapper {
  position: relative;
  width: 460px;
  height: 460px;
  max-width: 90vw;
  max-height: 90vw;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.6));
}

.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.08), 0 0 40px rgba(99, 102, 241, 0.35);
  transition: transform 0.05s linear;
}

.wheel-pointer {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 54px;
  z-index: 10;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
  transform-origin: 50% 10px;
  transition: transform 0.1s ease;
}

.wheel-pointer-icon {
  font-size: 40px;
  color: #f59e0b;
  display: block;
}

.wheel-center-cap {
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, #252b48 0%, #121829 100%);
  border: 4px solid #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), inset 0 2px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #ffffff;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.wheel-center-cap:hover {
  transform: scale(1.08);
}

.wheel-controls {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   全班抽籤 - 老虎機 / 懸疑滾動牌 (Suspense Slot Roller)
   -------------------------------------------------------------------------- */
.slot-stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  min-height: 480px;
}

.slot-reels-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 900px;
  margin-bottom: 30px;
}

.slot-card-box {
  width: 220px;
  height: 240px;
  background: radial-gradient(ellipse at top, #1e293b 0%, #0f172a 100%);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.slot-card-box.rolling {
  border-color: var(--accent-primary);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), inset 0 0 20px rgba(99, 102, 241, 0.3);
}

.slot-card-box.winner {
  border-color: #f59e0b;
  background: radial-gradient(ellipse at top, #3b2d12 0%, #1e1b13 100%);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.7), inset 0 0 30px rgba(245, 158, 11, 0.4);
  transform: translateY(-8px) scale(1.05);
}

.slot-badge-num {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.slot-avatar {
  font-size: 3.2rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.slot-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-card-box.winner .slot-name {
  color: #fef08a;
  text-shadow: 0 0 15px rgba(245, 158, 11, 0.8);
}

.slot-subinfo {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.slot-card-box.rolling .slot-name {
  filter: blur(2px);
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   全班抽籤 - 矩陣光速點亮 (Matrix Grid Spotlight)
   -------------------------------------------------------------------------- */
.matrix-stage-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(10, 14, 26, 0.5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.matrix-card {
  background: rgba(23, 31, 53, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  transition: all 0.15s ease;
  position: relative;
  cursor: pointer;
}

.matrix-card:hover {
  background: rgba(33, 44, 75, 0.9);
  border-color: rgba(99, 102, 241, 0.4);
}

.matrix-card.spotlight {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.9);
  transform: scale(1.08);
  z-index: 5;
  border-color: #ffffff;
}

.matrix-card.winner {
  background: #f59e0b !important;
  color: #0f172a !important;
  font-weight: 800;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.9);
  transform: scale(1.12);
  z-index: 10;
  animation: pulseGold 1s infinite alternate;
}

.matrix-card.drawn {
  opacity: 0.35;
  background: rgba(15, 23, 42, 0.5);
  border-color: transparent;
}

.matrix-card.absent {
  opacity: 0.35;
  text-decoration: line-through;
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.2);
}

.matrix-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.matrix-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

@keyframes pulseGold {
  from { box-shadow: 0 0 15px rgba(245, 158, 11, 0.6); }
  to { box-shadow: 0 0 35px rgba(245, 158, 11, 1); }
}

/* --------------------------------------------------------------------------
   全班抽籤 - 閃電極速抽 (Flash Pick)
   -------------------------------------------------------------------------- */
.flash-stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 440px;
}

.flash-big-display {
  width: 100%;
  max-width: 650px;
  min-height: 240px;
  background: radial-gradient(circle, #1a233d 0%, #0d1222 100%);
  border: 3px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.25);
  padding: 30px;
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

.flash-big-name {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-align: center;
}

.flash-countdown {
  font-size: 5rem;
  font-weight: 900;
  color: #f59e0b;
  text-shadow: 0 0 30px rgba(245, 158, 11, 0.7);
  animation: scaleBounce 0.5s ease-out;
}

@keyframes scaleBounce {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   模式二：小組抽籤樣式 (Group Draw)
   -------------------------------------------------------------------------- */
.groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.group-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.group-card.selected-group {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.group-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-members-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  flex: 1;
}

.member-tag {
  font-size: 0.84rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.member-tag:hover {
  background: rgba(99, 102, 241, 0.3);
}

.member-tag.drawn-rep {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}

/* 報告順序籤列表 */
.presentation-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.order-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(15px);
  animation: revealOrderItem 0.4s ease-out forwards;
}

@keyframes revealOrderItem {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.order-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: var(--glow-primary);
}

/* PK 競技場對決卡 */
.pk-arena {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.pk-pair-card {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(18, 24, 41, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  box-shadow: var(--shadow-md);
}

.pk-team {
  flex: 1;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.pk-vs-badge {
  font-size: 1.4rem;
  font-weight: 900;
  color: #f43f5e;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

/* --------------------------------------------------------------------------
   模式三：特定主題題目抽籤樣式 (Topic Draw & Mystery Box)
   -------------------------------------------------------------------------- */
.mystery-boxes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.mystery-box-card {
  height: 190px;
  background: radial-gradient(circle at 50% 30%, #222d4a 0%, #111728 100%);
  border: 2px solid rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  padding: 14px;
  overflow: hidden;
}

.mystery-box-card:hover:not(.opened) {
  transform: translateY(-6px) scale(1.03);
  border-color: #ec4899;
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.4);
}

.mystery-box-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
}

.mystery-box-card:hover:not(.opened) .mystery-box-icon {
  transform: scale(1.15) rotate(5deg);
}

.mystery-box-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.mystery-box-card.opened {
  background: #141b2f;
  border-color: rgba(16, 185, 129, 0.5);
  cursor: default;
}

.mystery-box-revealed-topic {
  display: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: #6ee7b7;
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
}

.mystery-box-revealed-target {
  font-size: 0.8rem;
  color: #fcd34d;
  margin-top: 6px;
  font-weight: 600;
}

.mystery-box-card.opened .mystery-box-icon {
  display: none;
}

.mystery-box-card.opened .mystery-box-revealed-topic {
  display: block;
  animation: fadeInView 0.3s ease;
}

/* 題目抽籤結果配對表格 */
.assignment-results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}

.assignment-results-table th, .assignment-results-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.assignment-results-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
}

.assignment-results-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* --------------------------------------------------------------------------
   獲獎 / 中籤榮譽彈出視窗 (Winner Modal Banner)
   -------------------------------------------------------------------------- */
.winner-banner-box {
  background: radial-gradient(circle at 50% 20%, #202b4a 0%, #0d1222 100%);
  border: 3px solid #f59e0b;
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.5), 0 25px 50px rgba(0, 0, 0, 0.8);
  max-width: 620px;
  width: 100%;
  position: relative;
  animation: popInWinner 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popInWinner {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.winner-crown-icon {
  font-size: 4rem;
  margin-bottom: 8px;
  animation: bounceCrown 1.5s infinite ease-in-out;
}

@keyframes bounceCrown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.winner-headline {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f59e0b;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.winner-cards-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.winner-single-card {
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.winner-person-name {
  font-size: 2.5rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.winner-person-sub {
  font-size: 1.05rem;
  color: #fcd34d;
  margin-top: 6px;
}
