/* custom trainer css style variables and layout overrides */
#pTrainer {
  font-family: 'Kanit', sans-serif;
}
#pTrainer button, #pTrainer input, #pTrainer select, #pTrainer textarea {
  font-family: 'Kanit', sans-serif;
}

:root {
  --trainer-accent: #38bdf8;
  --trainer-good: #22c55e;
  --trainer-bad: #ef4444;
  --trainer-warn: #f59e0b;
}

/* XP Profile Widget */
.trainer-profile-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 25px;
  backdrop-filter: blur(10px);
}

.trainer-profile-card .level-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--trainer-accent);
}

.trainer-xpbar {
  margin: 10px 0 6px;
  height: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.trainer-xpbar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--trainer-accent), var(--trainer-good));
  transition: width 0.3s ease;
}

/* Sub Navigation Tabs */
.trainer-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 25px;
  overflow-x: auto;
  padding-bottom: 5px;
  -webkit-overflow-scrolling: touch;
}

.trainer-tabs-nav button {
  white-space: nowrap;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 600;
  transition: 0.2s;
}

.trainer-tabs-nav button:active {
  transform: scale(0.97);
}

.trainer-tabs-nav button.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* Sub-views visibility */
.trainer-sub-view {
  display: none !important;
}
.trainer-sub-view.active {
  display: block !important;
}

/* Roster / Grid items */
.trainer-grid {
  display: grid;
  gap: 16px;
}
.trainer-grid.two {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 768px) {
  .trainer-grid.two {
    grid-template-columns: 1fr;
  }
}

.trainer-progress-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 15px;
}

.trainer-progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 14px;
}

.trainer-progress-item span.badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
}

.trainer-progress-item span.badge.open {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.trainer-progress-item span.badge.done {
  background: rgba(34, 197, 94, 0.1);
  color: var(--trainer-good);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Split View for Lessons */
.trainer-split {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}
@media (max-width: 768px) {
  .trainer-split {
    grid-template-columns: 1fr;
  }
}

.trainer-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trainer-lesson-list button {
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: 0.2s;
}

.trainer-lesson-list button.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.trainer-lesson-list button .small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

/* Spot Cards & KPIs */
.trainer-spot {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 20px;
  margin: 15px 0;
}

.trainer-spot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}
@media (max-width: 500px) {
  .trainer-spot-grid {
    grid-template-columns: 1fr;
  }
}

.trainer-kpi {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 10px 14px;
  text-align: center;
}

.trainer-kpi span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trainer-kpi b {
  display: block;
  font-size: 18px;
  color: #fff;
  margin-top: 4px;
}

.trainer-kpi b.hand {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
}

/* Action Buttons list */
.trainer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.trainer-actions button {
  flex: 1;
  min-width: 120px;
  border-radius: 14px;
  font-size: 15px;
}

/* Feedback Box */
.trainer-feedback {
  display: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  margin-top: 15px;
  line-height: 1.6;
}

.trainer-feedback.show {
  display: block;
}

.trainer-feedback.good {
  background: rgba(34, 197, 94, 0.05);
  border-color: rgba(34, 197, 94, 0.2);
}

.trainer-feedback.bad {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
}


/* =======================================================
   POKER TABLE SIMULATOR VISUALS
   ======================================================= */
.poker-table-felt {
  position: relative;
  width: 100%;
  height: 320px;
  background: radial-gradient(circle, #0e3d26 0%, #062214 75%, #03140b 100%);
  border: 10px solid #1e293b;
  border-radius: 160px;
  margin: 20px 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 12px 28px rgba(0, 0, 0, 0.5);
  overflow: visible;
}

/* Center Area */
.poker-center-area {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

.poker-pot-display {
  display: inline-block;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--trainer-accent);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.poker-community-cards {
  display: flex;
  gap: 4px;
  justify-content: center;
}

/* Custom Card Element */
.poker-card {
  position: relative;
  width: 30px;
  height: 42px;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
  font-weight: 800;
  font-size: 11px;
  color: #000;
  user-select: none;
  animation: cardDealAnim 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

.poker-card.red {
  color: #dc2626;
}

.poker-card.empty {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  box-shadow: none;
  color: transparent;
  animation: none;
}

.poker-card.back {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border: 2px solid #ffffff;
  color: transparent;
}

.poker-card .suit {
  align-self: flex-end;
  font-size: 12px;
  line-height: 1;
}

@keyframes cardDealAnim {
  0% {
    transform: translateY(-20px) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Seats Positioning */
.poker-seats-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.poker-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  width: 80px;
  pointer-events: auto;
}

.poker-seat:not(.seat-0) {
  cursor: pointer;
}

/* 6 Seats placement absolute */
.poker-seat.seat-0 { bottom: -20px; left: 50%; transform: translateX(-50%); } /* Hero */
.poker-seat.seat-1 { bottom: 35px; left: 5%; }
.poker-seat.seat-2 { top: 35px; left: 5%; }
.poker-seat.seat-3 { top: -20px; left: 50%; transform: translateX(-50%); }
.poker-seat.seat-4 { top: 35px; right: 5%; }
.poker-seat.seat-5 { bottom: 35px; right: 5%; }

.poker-player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.poker-player-avatar.hero {
  border-color: var(--trainer-accent);
  background: rgba(56, 189, 248, 0.1);
}

.poker-seat.active .poker-player-avatar {
  border-color: var(--trainer-good);
  box-shadow: 0 0 12px var(--trainer-good);
  animation: activePlayerPulse 1.5s infinite;
}

@keyframes activePlayerPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.poker-player-info {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 2px 6px;
  text-align: center;
  width: 90px;
  margin-top: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.poker-player-info .name {
  font-size: 9px;
  color: #fff;
  font-weight: 700;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.poker-player-info .stack {
  font-size: 9px;
  color: var(--trainer-accent);
  font-weight: bold;
}

.poker-player-cards {
  position: absolute;
  top: -24px;
  display: flex;
  gap: 1px;
  z-index: 6;
}

.poker-player-cards .poker-card {
  width: 20px;
  height: 28px;
  font-size: 8px;
  padding: 1px 2px;
}

.poker-player-cards .poker-card .suit {
  font-size: 8px;
}

/* Action Banner */
.poker-player-action-banner {
  position: absolute;
  top: -42px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  display: none;
  animation: actionBannerShow 0.2s ease-out both;
}

.poker-player-action-banner.fold { background: #64748b; }
.poker-player-action-banner.check { background: #0ea5e9; }
.poker-player-action-banner.call { background: #10b981; }
.poker-player-action-banner.raise { background: #f59e0b; }

@keyframes actionBannerShow {
  0% { transform: scale(0.6) translateY(5px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Dealer Button */
.poker-dealer-button {
  position: absolute;
  top: 18px;
  right: -10px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  color: #000;
  border: 1px solid #94a3b8;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 7;
}

.poker-dealer-button.show {
  display: flex;
}

/* Position Badges */
.poker-position-badge {
  position: absolute;
  top: 16px;
  left: -12px;
  width: 22px;
  height: 22px;
  background: #475569; /* Default slate */
  color: #ffffff;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  text-transform: uppercase;
  z-index: 7;
}

.poker-position-badge.show {
  display: flex;
}

.poker-position-badge.pos-btn { background: #0284c7; }
.poker-position-badge.pos-sb { background: #f97316; }
.poker-position-badge.pos-bb { background: #ef4444; }
.poker-position-badge.pos-utg,
.poker-position-badge.pos-mp,
.poker-position-badge.pos-co { background: #475569; }

/* Commentator Desk Box */
.poker-commentator-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 15px;
  margin-top: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  backdrop-filter: blur(8px);
}

.poker-commentator-box .avatar-desk {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 70px;
  flex-shrink: 0;
}

.poker-commentator-box .coach-photo {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--trainer-accent);
  object-fit: cover;
  margin-bottom: 4px;
}

.poker-commentator-box .poker-coach-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--trainer-accent);
  background: rgba(56, 189, 248, 0.1);
  color: var(--trainer-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.poker-commentator-box .coach-title {
  font-size: 8px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.poker-commentator-box .comment-text {
  font-size: 13px;
  line-height: 1.6;
  color: #fff;
  flex-grow: 1;
}

/* Action Controls Panel */
.poker-control-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 18px;
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.poker-prompt-line {
  font-size: 13px;
  color: var(--trainer-accent);
  text-align: center;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.3px;
}

.poker-raise-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px 14px;
  border-radius: 16px;
}

.poker-raise-bar .btn-sz {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.poker-raise-bar .btn-sz:hover {
  background: var(--primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px) scale(1.04);
}

.poker-raise-bar .btn-sz:active {
  transform: scale(0.96);
}

.poker-slider {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  outline: none;
  height: 8px;
  accent-color: var(--trainer-accent);
  cursor: pointer;
  transition: background 0.2s;
}

.poker-slider:hover {
  background: rgba(255, 255, 255, 0.18);
}

#pokerRaiseValueText {
  font-size: 14px;
  font-weight: 800;
  color: var(--trainer-accent);
  width: 65px;
  text-align: right;
  text-shadow: 0 0 4px rgba(56, 189, 248, 0.3);
}

.poker-main-actions {
  display: flex;
  gap: 12px;
}

.poker-main-actions button {
  flex: 1;
  border-radius: 16px;
  font-weight: 800;
  font-size: 15px;
  padding: 14px;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.poker-main-actions button:hover {
  transform: translateY(-2px) scale(1.02);
}

.poker-main-actions button:active {
  transform: scale(0.97);
}

.poker-main-actions button[onclick*="'fold'"] {
  background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.poker-main-actions button[onclick*="'fold'"]:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-color: #f87171;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
  color: #fff;
}

.poker-main-actions button#btnPokerCall {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.poker-main-actions button#btnPokerCall:hover {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border-color: #34d399;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.poker-main-actions button#btnPokerRaise {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.poker-main-actions button#btnPokerRaise:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  border-color: #fcd34d;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Hand History Timeline */
.poker-hand-log-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: 0.2s;
}

.poker-hand-log-item:hover {
  background: rgba(255,255,255,0.04);
}

.poker-hand-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.poker-hand-log-header span.h-num {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}

.poker-hand-log-header span.h-score {
  font-size: 11px;
  font-weight: 700;
}

.poker-hand-log-body {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

/* Responsive adjustment for poker table felt */
@media (max-width: 600px) {
  .poker-table-felt {
    height: 280px;
  }
  .poker-seat {
    width: 65px;
  }
  .poker-player-info {
    width: 75px;
  }
  .poker-seat.seat-1 { bottom: 25px; left: 2%; }
  .poker-seat.seat-2 { top: 25px; left: 2%; }
  .poker-seat.seat-4 { top: 25px; right: 2%; }
  .poker-seat.seat-5 { bottom: 25px; right: 2%; }
}

/* Preflop Range Matrix Styles */
.poker-matrix-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  max-width: 520px;
  margin: 0 auto;
}

.poker-matrix-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: default;
  user-select: none;
  transition: all 0.15s ease;
}

.poker-matrix-cell.raise {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* Interactive Quiz Styling */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.quiz-option-btn:hover:not(:disabled):not(.correct):not(.wrong) {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--trainer-accent);
  transform: translateX(4px);
}

.quiz-option-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.quiz-option-btn.correct {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
  border-color: #34d399 !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  cursor: default;
}

.quiz-option-btn.wrong {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
  border-color: #f87171 !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.quiz-option-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
}

.quiz-explanation-box {
  animation: explanationReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes explanationReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.shake-anim {
  animation: shakeEffect 0.4s ease both;
}

@keyframes shakeEffect {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

