/* ==========================================================================
   RAJA RAJA CHOLAN - FULL RESPONSIVE DISPLAY & MOBILE AUTO-FIT STYLESHEET
   Ultra-Responsive Engine Supporting All Phone Screen Aspect Ratios,
   Safe-Area Insets (Notches & Home Bars), Landscape & Portrait Auto-Fit,
   and Complete Back Navigation UI for All Screens & Modals
   ========================================================================== */

:root {
  --sfa-yellow: #fbc02d;
  --sfa-gold: #ffd54f;
  --sfa-orange: #ff6f00;
  --sfa-cyan: #00e5ff;
  --sfa-red: #d50000;
  --sfa-white-glow: rgba(255, 255, 255, 0.85);
  --sfa-dark-bg: rgba(12, 10, 8, 0.75);
  --font-royal: 'Cinzel', serif;
  --font-timer: 'Teko', sans-serif;
  --font-tamil: 'Mukta Malar', sans-serif;
  --font-body: 'Montserrat', sans-serif;

  /* Safe Area Insets for Mobile Notches & Navigation Bars */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  background-color: #040303;
  background-image: radial-gradient(circle at 50% 50%, #1a100a 0%, #040303 100%);
  color: #f1ebd9;
  font-family: var(--font-body);
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  width: 100dvw;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #000000;
  box-sizing: border-box;
}

#canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-width: 100dvw;
  max-height: 100dvh;
  background-color: #0c0908;
  overflow: hidden;
  margin: auto;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

canvas#gameCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ==========================================================================
   MOBILE ORIENTATION & ROTATION DETECTION OVERLAY
   ========================================================================== */
.orientation-hint-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 5, 3, 0.95);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-align: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  box-sizing: border-box;
}

.orientation-hint-overlay.show-rotate {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.rotate-phone-anim {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-icon {
  width: 30px;
  height: 52px;
  border: 3px solid #ffd54f;
  border-radius: 6px;
  position: relative;
  animation: rotatePhone 2.2s infinite ease-in-out;
  box-shadow: 0 0 15px rgba(255, 213, 79, 0.4);
}

.phone-icon::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd54f;
}

@keyframes rotatePhone {
  0%, 15% { transform: rotate(0deg); }
  50%, 85% { transform: rotate(90deg); }
  100% { transform: rotate(90deg); }
}

.orientation-hint-overlay h2 {
  font-family: var(--font-tamil);
  font-size: clamp(16px, 4vw, 22px);
  color: #ffd54f;
  margin-bottom: 6px;
}

.orientation-hint-overlay p {
  font-family: var(--font-royal);
  font-size: clamp(10px, 2.2vw, 12px);
  color: #dfd4c5;
  letter-spacing: 1px;
  max-width: 360px;
}

/* ==========================================================================
   SHADOW FIGHT TOP HUD BAR (RESPONSIVE AUTO-FIT WITH PAUSE/BACK)
   ========================================================================== */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: clamp(4px, 1.2vh, 8px) max(clamp(8px, 2vw, 18px), var(--sar)) clamp(4px, 1.2vh, 8px) max(clamp(8px, 2vw, 18px), var(--sal));
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.3s ease;
  box-sizing: border-box;
}

.hud-hidden {
  opacity: 0;
  pointer-events: none !important;
}

/* Corner Diamond Shadow Badges */
.shadow-badge {
  width: clamp(24px, 4vmin, 38px);
  height: clamp(24px, 4vmin, 38px);
  background: rgba(10, 8, 6, 0.85);
  border: 1.5px solid var(--sfa-cyan);
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  flex-shrink: 0;
}

.shadow-gem {
  width: clamp(12px, 2vmin, 20px);
  height: clamp(12px, 2vmin, 20px);
  background: radial-gradient(circle, #00e5ff, #01579b);
  border-radius: 2px;
  animation: shadowPulse 2s infinite alternate;
}

@keyframes shadowPulse {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px #00e5ff; }
}

/* Main Top Bar */
.sfa-top-bar {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  margin: 0 clamp(4px, 1vw, 12px);
  gap: clamp(4px, 1vw, 10px);
  box-sizing: border-box;
}

.fighter-bar-box {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.p1-box { align-items: flex-start; }
.p2-box { align-items: flex-end; }

.fighter-header {
  display: flex;
  align-items: center;
  gap: clamp(3px, 0.8vw, 6px);
  margin-bottom: 2px;
  width: 100%;
  overflow: hidden;
}

.p2-box .fighter-header {
  justify-content: flex-end;
}

.sfa-name {
  font-family: var(--font-royal);
  font-size: clamp(8px, 1.4vw, 13px);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff8e1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Round Win Dots */
.round-gems {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.round-dot {
  width: clamp(5px, 0.9vw, 8px);
  height: clamp(5px, 0.9vw, 8px);
  background: #2b1f18;
  border: 1px solid #735438;
  transform: rotate(45deg);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.round-dot.won {
  background: radial-gradient(circle, #00e5ff, #0097a7);
  border-color: #ffffff;
  box-shadow: 0 0 8px #00e5ff;
}

/* Health Bar Tracks */
.sfa-health-track {
  position: relative;
  width: 100%;
  height: clamp(9px, 1.6vw, 14px);
  background: rgba(15, 10, 6, 0.9);
  border: 1.5px solid #5c432d;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 2px 6px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
}

.p1-box .sfa-health-track {
  transform: skewX(-15deg);
}

.p2-box .sfa-health-track {
  transform: skewX(15deg);
}

.sfa-health-fill {
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #fbc02d 0%, #ffd54f 60%, #ffffff 100%);
  box-shadow: 0 0 8px rgba(255, 213, 79, 0.6);
  transition: width 0.1s linear;
}

.p1-box .sfa-health-fill { left: 0; }
.p2-box .sfa-health-fill { right: 0; background: linear-gradient(270deg, #d50000 0%, #ff5252 60%, #ffffff 100%); }

.sfa-health-delayed {
  position: absolute;
  top: 0;
  height: 100%;
  width: 100%;
  background: #ff1744;
  opacity: 0.85;
}
.p1-box .sfa-health-delayed { left: 0; }
.p2-box .sfa-health-delayed { right: 0; }

.sfa-guard-fill {
  position: absolute;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: #00e5ff;
}
.p1-box .sfa-guard-fill { left: 0; }
.p2-box .sfa-guard-fill { right: 0; }

/* Numerical HP Text */
.sfa-hp-text {
  font-family: var(--font-body);
  font-size: clamp(7px, 1.1vw, 10px);
  font-weight: 700;
  color: #cfd8dc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  margin-top: 1px;
}

/* Center Timer & Area Badge & Pause Navigation */
.center-hud-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sfa-timer-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-divider {
  width: 2px;
  height: clamp(14px, 2.2vw, 22px);
  background: linear-gradient(180deg, rgba(255,215,0,0.8), rgba(0,0,0,0));
}

#match-timer {
  font-family: var(--font-timer);
  font-size: clamp(20px, 3.8vw, 36px);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 10px rgba(255,215,0,0.4);
  line-height: 1;
}

.hud-center-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.temple-area-badge {
  background: rgba(20, 14, 10, 0.9);
  border: 1px solid var(--sfa-gold);
  border-radius: 12px;
  padding: 1px clamp(4px, 0.8vw, 8px);
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-royal);
  font-size: clamp(6.5px, 1vw, 8.5px);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffd54f;
  box-shadow: 0 0 8px rgba(255, 111, 0, 0.4);
  white-space: nowrap;
}

.hud-pause-btn {
  background: linear-gradient(135deg, rgba(45, 30, 20, 0.98), rgba(20, 14, 10, 0.98));
  border: 1.5px solid var(--sfa-gold);
  border-radius: 16px;
  padding: clamp(3px, 0.6vh, 6px) clamp(8px, 1.4vw, 16px);
  color: #ffd54f;
  font-family: var(--font-royal);
  font-size: clamp(8.5px, 1.3vw, 12px);
  font-weight: 900;
  letter-spacing: 0.8px;
  cursor: pointer;
  pointer-events: auto !important;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

.hud-pause-btn:hover, .hud-pause-btn:active {
  background: linear-gradient(135deg, #ffd54f, #d4af37);
  color: #0c0804;
  border-color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.7);
}

/* ==========================================================================
   RESPONSIVE ON-SCREEN TOUCH & MOUSE CONTROLS (AUTO-FIT)
   ========================================================================== */
.sfa-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: clamp(6px, 1.5vh, 16px) max(clamp(10px, 2.5vw, 28px), var(--sar)) max(clamp(6px, 1.5vh, 16px), var(--sab)) max(clamp(10px, 2.5vw, 28px), var(--sal));
  box-sizing: border-box;
}

/* Left: Virtual Circular Analog Joystick */
.sfa-joystick-wrapper {
  position: relative;
  width: clamp(85px, 17vmin, 130px);
  height: clamp(85px, 17vmin, 130px);
  pointer-events: auto;
  touch-action: none;
  flex-shrink: 0;
}

.sfa-joystick-base {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 20, 12, 0.5) 0%, rgba(10, 7, 4, 0.8) 100%);
  border: 2px solid rgba(255, 215, 79, 0.5);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(255, 111, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.joystick-notch {
  position: absolute;
  color: rgba(255, 215, 79, 0.6);
  font-size: clamp(7px, 1.1vw, 10px);
}

.notch-up { top: 3px; }
.notch-right { right: 5px; }
.notch-down { bottom: 3px; }
.notch-left { left: 5px; }

.sfa-joystick-thumb {
  width: clamp(36px, 7vmin, 52px);
  height: clamp(36px, 7vmin, 52px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd54f, #ff6f00 70%, #b71c1c);
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 152, 0, 0.6);
  cursor: grab;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease-out;
}

/* Right: Action Button Cluster */
.sfa-actions-cluster {
  position: relative;
  width: clamp(130px, 24vmin, 195px);
  height: clamp(105px, 20vmin, 160px);
  pointer-events: auto;
  flex-shrink: 0;
  box-sizing: border-box;
}

.sfa-btn {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(45, 30, 18, 0.9), rgba(12, 8, 5, 0.96));
  border: 2px solid rgba(255, 215, 79, 0.65);
  box-shadow: 0 4px 14px rgba(0,0,0,0.85), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s ease, border-color 0.1s ease;
  box-sizing: border-box;
}

.sfa-btn:active {
  transform: scale(0.92) !important;
  border-color: #ffffff;
  box-shadow: 0 0 20px #ffd54f;
}

.btn-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.btn-icon {
  font-size: clamp(13px, 2.4vmin, 20px);
  line-height: 1;
}

.btn-sub {
  font-family: var(--font-royal);
  font-size: clamp(6.5px, 1vmin, 8.5px);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffd54f;
}

/* Specific Action Button Sizing & Positions */
.sfa-btn-weapon {
  width: clamp(42px, 8vmin, 62px);
  height: clamp(42px, 8vmin, 62px);
  right: 34%;
  bottom: 28%;
  border-color: #ffd54f;
  background: radial-gradient(circle at 35% 35%, #e65100, #3e2723);
}

.sfa-btn-kick {
  width: clamp(38px, 7vmin, 54px);
  height: clamp(38px, 7vmin, 54px);
  right: 2%;
  bottom: 8%;
  border-color: #ff9800;
}

.sfa-btn-parry {
  width: clamp(34px, 6.2vmin, 48px);
  height: clamp(34px, 6.2vmin, 48px);
  right: 62%;
  bottom: 4%;
  border-color: var(--sfa-cyan);
}

.sfa-btn-astra {
  width: clamp(40px, 7.2vmin, 56px);
  height: clamp(40px, 7.2vmin, 56px);
  right: 12%;
  top: 4%;
  border-color: #00e5ff;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
  animation: astraPulse 1.8s infinite alternate;
}

@keyframes astraPulse {
  0% { box-shadow: 0 0 8px #00e5ff; }
  100% { box-shadow: 0 0 22px #00e5ff, 0 0 35px rgba(255, 215, 0, 0.4); }
}

.sfa-btn-roll {
  width: clamp(32px, 5.8vmin, 44px);
  height: clamp(32px, 5.8vmin, 44px);
  right: 58%;
  top: 10%;
  border-color: #8d6e63;
}

/* ==========================================================================
   SCREENS & MODALS (RESPONSIVE AUTO-FIT)
   ========================================================================== */
.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 40%, rgba(26, 16, 10, 0.95), rgba(4, 3, 2, 0.98));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: clamp(8px, 1.8vh, 20px) max(clamp(10px, 2.5vw, 24px), var(--sar)) max(clamp(8px, 1.8vh, 20px), var(--sab)) max(clamp(10px, 2.5vw, 24px), var(--sal));
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.game-screen.active-screen {
  opacity: 1;
  pointer-events: auto;
}

.ornament-header {
  text-align: center;
  margin-bottom: clamp(8px, 2vh, 16px);
  max-width: 100%;
}

.sub-title {
  font-family: var(--font-royal);
  font-size: clamp(8px, 1.3vw, 12px);
  letter-spacing: 1.5px;
  color: #d1b894;
}

.main-title {
  font-family: var(--font-royal);
  font-size: clamp(20px, 4.2vw, 40px);
  font-weight: 900;
  letter-spacing: clamp(1px, 0.5vw, 2.5px);
  color: #fff9e6;
  text-shadow: 0 0 25px rgba(255, 111, 0, 0.7);
  line-height: 1.1;
}

.tamil-title {
  font-family: var(--font-tamil);
  font-size: clamp(11px, 2vw, 17px);
  color: #ffd54f;
  margin-top: 2px;
}

.menu-button-group {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 14px);
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.royal-btn {
  position: relative;
  background: linear-gradient(180deg, #382519 0%, #1c110a 100%);
  color: #f7eed7;
  border: 1.5px solid #8f6c3d;
  padding: clamp(9px, 1.6vh, 14px) clamp(12px, 2vw, 20px);
  border-radius: 6px;
  font-family: var(--font-royal);
  font-size: clamp(11px, 1.5vw, 14px);
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.royal-btn:hover, .royal-btn:active {
  background: linear-gradient(180deg, #573a27 0%, #2e1c10 100%);
  border-color: #ffd54f;
  color: #ffffff;
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(180deg, #b71c1c 0%, #540c0e 100%);
  border-color: #ffd54f;
}

.secondary-btn {
  background: #1a1411;
  border-color: #574134;
}

.pulse-glow {
  animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 10px #ff6f00; }
  100% { box-shadow: 0 0 25px #ffd54f, 0 0 40px rgba(255, 87, 34, 0.5); }
}

.audio-banner {
  margin-top: clamp(8px, 1.8vh, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.sound-toggle-btn {
  background: transparent;
  border: 1px solid #735338;
  color: #dfcaa7;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: clamp(8.5px, 1.1vw, 10.5px);
  font-weight: 600;
  cursor: pointer;
}

.temple-tagline {
  font-size: clamp(8.5px, 1.1vw, 10.5px);
  color: #a8937d;
  text-align: center;
  max-width: 90%;
}

/* ==========================================================================
   MODALS (CONTROLS & PAUSE WITH BACK NAVIGATION)
   ========================================================================== */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 3, 2, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
  padding: 12px;
  box-sizing: border-box;
}
.game-modal.modal-active { opacity: 1; pointer-events: auto; }

.modal-content {
  width: 95%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #18110d;
  border: 2px solid #b8860b;
  border-radius: 8px;
  padding: clamp(10px, 2vw, 20px);
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #4a3424;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.modal-header h2 { font-family: var(--font-royal); font-size: clamp(12px, 1.8vw, 15px); color: #fff1be; }
.close-btn { background: none; border: none; color: #baa48b; font-size: 22px; cursor: pointer; }

.controls-grid {
  display: flex;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.control-column {
  flex: 1 1 0;
  background: #100b08;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #3d2b1f;
  min-width: 0;
  box-sizing: border-box;
}

.control-column h3 {
  font-family: var(--font-royal);
  font-size: clamp(9.5px, 1.3vw, 11.5px);
  color: #ffd54f;
  margin-bottom: 6px;
  border-bottom: 1px dashed #4a3424;
  padding-bottom: 3px;
}

.key-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: clamp(8px, 1.1vw, 10px);
  color: #dfd4c5;
}

kbd {
  background: #33241b;
  border: 1px solid #735438;
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 700;
  color: #fff;
}

.modal-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.back-modal-btn {
  width: auto !important;
  padding: 5px 14px !important;
  font-size: clamp(9px, 1.2vw, 11px) !important;
}

.pause-content {
  max-width: 380px;
  text-align: center;
}
.pause-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   VICTORY SCREEN
   ========================================================================== */
.victory-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  box-sizing: border-box;
}

.victory-sub {
  font-family: var(--font-tamil);
  font-size: clamp(11px, 1.8vw, 14px);
  font-weight: 800;
  color: #ffd54f;
}

.victory-main {
  font-family: var(--font-royal);
  font-size: clamp(20px, 4.2vw, 36px);
  font-weight: 900;
  color: #fffbf0;
  text-shadow: 0 0 35px #ff6f00;
}

.victory-quote {
  font-family: var(--font-tamil);
  font-size: clamp(10px, 1.5vw, 13px);
  color: #f7e0b5;
  max-width: 480px;
  margin: 4px 0;
}

.match-stats-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, 1.5vw, 16px);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #574030;
  max-width: 100%;
  box-sizing: border-box;
}

.stat-item {
  font-size: clamp(9px, 1.2vw, 11px);
  color: #d1b894;
}

.stat-item span:last-child {
  font-weight: 700;
  color: #fff;
  margin-left: 3px;
}

.victory-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ==========================================================================
   ANNOUNCER & COMBOS
   ========================================================================== */
#announcer-banner {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 40;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 90%;
  max-width: 500px;
}

.announcer-hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6) !important;
}

#announcer-main-text {
  font-family: var(--font-tamil);
  font-size: clamp(22px, 5vw, 44px);
  font-weight: 900;
  color: #ffd54f;
  text-shadow: 0 0 20px #ff6f00, 0 0 40px #d50000;
  letter-spacing: 1px;
}

#announcer-sub-text {
  font-family: var(--font-royal);
  font-size: clamp(10px, 1.8vw, 16px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 2px;
}

.combo-counter {
  position: absolute;
  top: 24%;
  font-family: var(--font-royal);
  font-weight: 900;
  color: #ffd54f;
  text-shadow: 0 0 15px #ff6f00;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  line-height: 1.1;
  text-align: center;
}

.combo-visible {
  opacity: 1;
  transform: scale(1.08);
}

.combo-left { left: max(4%, var(--sal)); font-size: clamp(12px, 2.2vw, 18px); }
.combo-right { right: max(4%, var(--sar)); font-size: clamp(12px, 2.2vw, 18px); }
.combo-number { font-size: clamp(22px, 4.2vw, 40px); color: #ffffff; }
.combo-praise { font-family: var(--font-tamil); font-size: clamp(9px, 1.5vw, 12px); color: #00e5ff; }

/* ==========================================================================
   MOBILE MEDIA QUERY BREAKPOINTS
   ========================================================================== */
/* ==========================================================================
   TOP-LEFT BACK BUTTON WITH CONFIRMATION & CREATOR CREDITS
   ========================================================================== */
.top-left-back-btn {
  position: absolute;
  top: clamp(60px, 9.8vh, 74px);
  left: max(12px, var(--sal));
  background: rgba(18, 14, 10, 0.94);
  border: 1.5px solid #ffd54f;
  color: #ffd54f;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-royal);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 60;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 10px rgba(212, 175, 55, 0.25);
  letter-spacing: 0.5px;
}

.top-left-back-btn:hover {
  background: linear-gradient(135deg, #d4af37, #996515);
  color: #0c0804;
  border-color: #ffe082;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
  transform: translateY(-1px) scale(1.04);
}

/* Top-Right Feedback Button (Symmetrically matched to Back button height) */
.top-right-feedback-btn {
  position: absolute;
  top: clamp(60px, 9.8vh, 74px);
  right: max(12px, var(--sar));
  background: rgba(22, 16, 12, 0.94);
  border: 1.5px solid rgba(255, 213, 79, 0.6);
  color: #ffd54f;
  padding: 5px 12px;
  border-radius: 18px;
  font-family: var(--font-royal);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  z-index: 55;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), 0 0 10px rgba(212, 175, 55, 0.2);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  letter-spacing: 0.5px;
}

.top-right-feedback-btn:hover {
  background: linear-gradient(135deg, #d4af37, #996515);
  color: #0c0804;
  border-color: #ffe082;
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.5);
  transform: translateY(-1px) scale(1.04);
}

.simple-feedback-modal {
  max-width: 400px !important;
  width: 90% !important;
  padding: 18px 22px !important;
  text-align: center;
  border: 1px solid #ffd54f !important;
  background: linear-gradient(145deg, rgba(22, 16, 12, 0.98) 0%, rgba(10, 8, 6, 0.99) 100%) !important;
}

.simple-feedback-modal .star-btn {
  font-size: 30px;
  padding: 2px 4px;
}

.top-left-back-btn:active {
  transform: scale(0.96);
}

.back-icon {
  font-size: 13px;
}

/* Creator Credits Badge on Front Screen */
.creator-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(28, 20, 14, 0.92) 0%, rgba(14, 10, 7, 0.96) 100%);
  border: 1px solid rgba(255, 213, 79, 0.45);
  border-radius: 24px;
  padding: 5px 16px;
  margin: 6px auto 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.2);
  max-width: 90%;
  animation: shimmer-border 3s infinite alternate;
}

@keyframes shimmer-border {
  0% { border-color: rgba(255, 213, 79, 0.35); box-shadow: 0 0 10px rgba(212, 175, 55, 0.15); }
  100% { border-color: rgba(255, 213, 79, 0.75); box-shadow: 0 0 22px rgba(255, 213, 79, 0.4); }
}

.creator-crown {
  font-size: 16px;
  filter: drop-shadow(0 0 6px rgba(255, 213, 79, 0.7));
}

.creator-text {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.creator-title {
  font-family: var(--font-royal);
  font-size: clamp(10px, 1.4vw, 12px);
  font-weight: 800;
  color: #ffd54f;
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(255, 213, 79, 0.4);
}

.creator-tamil {
  font-family: var(--font-tamil);
  font-size: clamp(9px, 1.2vw, 11px);
  font-weight: 600;
  color: #e0be6c;
  line-height: 1.1;
}

/* Master Volume Slider Control (Initial 40%) */
.volume-slider-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 10, 7, 0.85);
  border: 1px solid #4a3725;
  padding: 4px 10px;
  border-radius: 20px;
}

.vol-btn {
  background: rgba(45, 32, 20, 0.9);
  border: 1px solid #735328;
  color: #ffd54f;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vol-btn:hover {
  background: #ffd54f;
  color: #0c0804;
  transform: scale(1.1);
}

.vol-input-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gold-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 75px;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.gold-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffd54f;
  box-shadow: 0 0 8px rgba(255, 213, 79, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.gold-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.vol-percent {
  font-family: var(--font-royal);
  font-size: 11px;
  font-weight: 700;
  color: #ffd54f;
  min-width: 32px;
  text-align: center;
}

/* Confirmation & Fullscreen Modal Content */
.confirm-modal-content, .fullscreen-modal-content {
  max-width: 440px;
  width: 90%;
  text-align: center;
  border: 1px solid #ffd54f;
  box-shadow: 0 0 45px rgba(212, 175, 55, 0.35), 0 20px 40px rgba(0, 0, 0, 0.95);
  background: linear-gradient(145deg, rgba(24, 17, 12, 0.98) 0%, rgba(10, 7, 5, 0.99) 100%);
  padding: 22px 24px;
}

.confirm-emblem, .fullscreen-emblem {
  font-size: 36px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(255, 213, 79, 0.5));
}

.confirm-modal-content h2, .fullscreen-modal-content h2 {
  font-family: var(--font-royal);
  font-size: clamp(14px, 2.2vw, 17px);
  color: #ffd54f;
  margin-bottom: 8px;
}

.confirm-modal-content p, .fullscreen-modal-content p {
  font-size: 12px;
  color: #cfc2ae;
  line-height: 1.4;
  margin-bottom: 18px;
}

.confirm-modal-buttons, .fullscreen-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-btn:hover {
  border-color: #ff3d00 !important;
  background: rgba(70, 20, 15, 0.95) !important;
  box-shadow: 0 0 14px rgba(255, 61, 0, 0.4) !important;
}

.fullscreen-header-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 213, 79, 0.15);
  color: #ffd54f;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 213, 79, 0.35);
  margin-bottom: 8px;
  letter-spacing: 0.8px;
}


/* ==========================================================================
   FEEDBACK MODAL, RATING STARS & TOAST NOTIFICATIONS
   ========================================================================== */
#modal-feedback .modal-content {
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid #d4af37;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.35), 0 20px 40px rgba(0, 0, 0, 0.9);
  background: linear-gradient(145deg, rgba(22, 16, 12, 0.96) 0%, rgba(10, 8, 6, 0.98) 100%);
  padding: 16px 20px;
}

.feedback-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.15);
  color: #ffd54f;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.feedback-section {
  margin-bottom: 12px;
  text-align: left;
}

.feedback-label {
  font-family: var(--font-royal);
  font-size: 11px;
  font-weight: 700;
  color: #e6caa3;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.5px;
}

.feedback-label span.highlight {
  color: #ffd54f;
}

/* Star Rating */
.star-rating-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: clamp(24px, 5vw, 32px);
  color: #4a3b2c;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 2px;
  text-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.star-btn:hover, .star-btn.selected {
  color: #ffd54f;
  transform: scale(1.18);
  text-shadow: 0 0 16px #ff9800, 0 0 30px #ffd54f;
}

.rating-caption {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #ffd54f;
  min-height: 18px;
  margin-bottom: 8px;
}

/* Difficulty & Sentiment Chips */
.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  background: rgba(30, 22, 16, 0.8);
  border: 1px solid #4a3725;
  color: #c7b299;
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.chip-btn:hover {
  border-color: #ffd54f;
  color: #fff;
}

.chip-btn.active {
  background: linear-gradient(135deg, #d4af37, #996515);
  color: #0c0804;
  font-weight: 800;
  border-color: #ffd54f;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* Feedback Inputs */
.feedback-input, .feedback-textarea {
  width: 100%;
  background: rgba(14, 10, 8, 0.85);
  border: 1px solid #4a3725;
  color: #f7e0b5;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feedback-input:focus, .feedback-textarea:focus {
  border-color: #ffd54f;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.feedback-textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 120px;
}

/* Toast Notifications */
#feedback-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #1f160e 0%, #0d0906 100%);
  border: 1px solid #d4af37;
  color: #ffd54f;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#feedback-toast.toast-active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

