/* ==========================================================================
   ERP SMASH: THE FRUSTRATED EMPLOYEE (CORPORATE RAGE BEAT-'EM-UP)
   Styled for games.html - Kishan Kumar Sharma Portfolio
   ========================================================================== */

/* Game Tab Navigation Bar */
.games-tab-switcher {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.game-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 25px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #94A3B8;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
}

.game-tab-btn:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.game-tab-btn.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(185, 28, 28, 0.3) 100%);
  border-color: #EF4444;
  color: #FCA5A5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}

.game-tab-btn.active.tab-river {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2) 0%, rgba(37, 99, 235, 0.3) 100%);
  border-color: #38BDF8;
  color: #7DD3FC;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

/* --------------------------------------------------------------------------
   ERP SMASH MAIN CONSOLE CARD
   -------------------------------------------------------------------------- */
#erpSmashSection {
  scroll-margin-top: 100px;
}

.erp-smash-console {
  background: linear-gradient(180deg, #11070A 0%, #080306 100%);
  border: 2px solid rgba(239, 68, 68, 0.4);
  border-radius: 28px;
  box-shadow: 
    0 35px 90px -15px rgba(0, 0, 0, 0.95),
    0 0 50px -10px rgba(239, 68, 68, 0.25);
  padding: 24px;
  max-width: 1040px;
  margin: 0 auto 60px;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 100px;
}

/* Frustration Top Header & Story Bar */
.erp-story-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(26, 8, 12, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.erp-player-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.erp-avatar-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1E0E12;
  border: 2px solid #EF4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.erp-player-info {
  display: flex;
  flex-direction: column;
}

.erp-player-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.04em;
}

.erp-player-role {
  font-size: 0.72rem;
  font-weight: 700;
  color: #F87171;
  text-transform: uppercase;
}

.erp-hud-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}

.erp-hud-pill {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.erp-hud-pill-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #94A3B8;
  text-transform: uppercase;
}

.erp-hud-pill-val {
  font-size: 1.1rem;
  font-weight: 900;
  font-family: var(--font-display, var(--font-heading));
  color: #FBBF24;
}

/* --------------------------------------------------------------------------
   START / CUSTOMIZATION SCREEN (NAME & DESIGNATION INPUT)
   -------------------------------------------------------------------------- */
.erp-setup-screen {
  position: relative;
  width: 100%;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  text-align: center;
}

.erp-setup-card {
  background: linear-gradient(180deg, #1A090D 0%, #0D0407 100%);
  border: 2px solid #EF4444;
  border-radius: 24px;
  padding: 28px 32px;
  max-width: 540px;
  width: 95%;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 40px rgba(239, 68, 68, 0.3);
}

.erp-setup-title {
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 900;
  color: #EF4444;
  text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.erp-setup-subtitle {
  font-size: 0.88rem;
  color: #CBD5E1;
  margin-bottom: 20px;
  line-height: 1.45;
}

/* Gender Selection Tabs */
.erp-gender-selector {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
}

.gender-option {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gender-option:hover {
  border-color: rgba(239, 68, 68, 0.5);
}

.gender-option.selected {
  background: rgba(239, 68, 68, 0.18);
  border-color: #EF4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}

.gender-emoji {
  font-size: 2.2rem;
}

.gender-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
}

/* Input Fields */
.erp-input-group {
  margin-bottom: 14px;
  text-align: left;
}

.erp-input-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #F87171;
  margin-bottom: 6px;
}

.erp-text-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  outline: none;
  transition: all 0.25s ease;
}

.erp-text-input:focus {
  border-color: #EF4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.btn-start-rampage {
  width: 100%;
  padding: 13px 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
  color: #FFFFFF;
  border: 1px solid #F87171;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.6);
  transition: all 0.25s ease;
  margin-top: 10px;
}

.btn-start-rampage:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 40px rgba(220, 38, 38, 0.85);
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
}

/* --------------------------------------------------------------------------
   THE 2D ARENA / BATTLE STAGE
   -------------------------------------------------------------------------- */
.erp-arena-stage {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid rgba(239, 68, 68, 0.35);
  background: #0D0407;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
  user-select: none;
}

/* Department Themed Background Floors */
.arena-floor {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.25;
  transition: all 0.5s ease;
}

.floor-grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(239, 68, 68, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 68, 68, 0.08) 1px, transparent 1px);
  background-size: 35px 35px;
  pointer-events: none;
}

/* Office Floor Props (Funny Obstacles) */
.arena-office-props {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
}

.office-prop {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.75;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.8));
  user-select: none;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease;
}

.prop-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.prop-tag {
  font-size: 0.56rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

/* Department Banner at Top of Arena */
.arena-dept-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 3, 6, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 5px 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
}

.dept-stage-pill {
  font-size: 0.65rem;
  font-weight: 900;
  background: #EF4444;
  color: #FFFFFF;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.06em;
}

.dept-name-text {
  font-size: 0.82rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.04em;
}

/* HOD Health / Stamina Bar */
.hod-hp-container {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 4px 6px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hod-hp-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 800;
  color: #CBD5E1;
}

.hod-hp-track {
  width: 100%;
  height: 8px;
  background: #1E0A0E;
  border-radius: 4px;
  overflow: hidden;
}

.hod-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #EF4444 0%, #F59E0B 100%);
  border-radius: 4px;
  transition: width 0.2s cubic-bezier(0.2, 0.8, 0.4, 1);
}

/* --------------------------------------------------------------------------
   CHARACTERS: PLAYER & HOD ENTITIES
   -------------------------------------------------------------------------- */
.game-entity {
  position: absolute;
  width: 56px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 20;
  transition: transform 0.08s linear;
  pointer-events: none;
}

/* Player Entity */
.player-entity .sprite-body {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
  position: relative;
}

/* Bat in Player's Hand */
.player-entity .sprite-bat {
  position: absolute;
  top: 2px;
  right: -14px;
  font-size: 1.4rem;
  transform-origin: bottom left;
  transform: rotate(20deg);
  transition: transform 0.08s ease;
}

/* Bat Swing Strike Animation */
.player-entity.swinging .sprite-bat {
  animation: batHomeRunStrike 0.18s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

@keyframes batHomeRunStrike {
  0% { transform: rotate(-45deg) scale(1.1); }
  50% { transform: rotate(85deg) scale(1.35); }
  100% { transform: rotate(20deg) scale(1); }
}

.player-entity .entity-tag {
  font-size: 0.58rem;
  font-weight: 800;
  background: rgba(14, 165, 233, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7DD3FC;
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 2px;
  white-space: nowrap;
}

/* HOD Entity */
.hod-entity .sprite-body {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
  position: relative;
}

.hod-entity .entity-tag {
  font-size: 0.58rem;
  font-weight: 800;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #FCA5A5;
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 2px;
  white-space: nowrap;
}

/* HOD Fear Sweating */
.hod-sweat {
  position: absolute;
  top: -8px;
  right: -6px;
  font-size: 1rem;
  animation: sweatDrop 0.8s ease-in-out infinite;
}

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

/* HOD Getting Hit Flash */
.hod-entity.hit-flash {
  animation: hodHitShake 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
  filter: brightness(2) drop-shadow(0 0 15px #EF4444);
}

@keyframes hodHitShake {
  0% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  25% { transform: translate(-50%, -50%) scale(1.2) rotate(-14deg); }
  50% { transform: translate(-50%, -50%) scale(0.9) rotate(14deg); }
  75% { transform: translate(-50%, -50%) scale(1.1) rotate(-6deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(0); }
}

/* HOD Dialogue Bubble */
.hod-bubble {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  color: #0F172A;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 25;
}

.hod-bubble::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px 4px 0;
  border-style: solid;
  border-color: #FFFFFF transparent;
}

.hod-bubble.show {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   COMIC FLASH WORDS ON HIT ("ABEY SAALEY", "KUTTEY", "KAMINEY")
   -------------------------------------------------------------------------- */
.comic-flash-word {
  position: absolute;
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%) scale(0.5);
  animation: comicWordPop 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  text-shadow: 
    3px 3px 0px #000,
    -3px -3px 0px #000,
    3px -3px 0px #000,
    -3px 3px 0px #000,
    0 0 20px currentColor;
}

@keyframes comicWordPop {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(-15deg); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.3) rotate(6deg); opacity: 1; }
  70% { transform: translate(-50%, -65px) scale(1) rotate(-4deg); opacity: 1; }
  100% { transform: translate(-50%, -85px) scale(0.8) rotate(0); opacity: 0; }
}

/* Screen Shake Effect */
.erp-arena-stage.shake {
  animation: arenaScreenShake 0.22s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes arenaScreenShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Impact Stars Particle */
.hit-star-particle {
  position: absolute;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 45;
  animation: starBurst 0.45s ease-out forwards;
}

@keyframes starBurst {
  0% { transform: translate(-50%, -50%) scale(0.4) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(180deg); opacity: 0; }
}

/* --------------------------------------------------------------------------
   BOTTOM CONTROLS BAR (DESKTOP SPACEBAR & MOBILE TOUCH CONTROLS)
   -------------------------------------------------------------------------- */
.erp-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(14, 5, 8, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.erp-instructions-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94A3B8;
  font-weight: 700;
}

.key-badge {
  background: #1E293B;
  border: 1px solid #475569;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 0 #0F172A;
}

/* Mobile Virtual Joystick & Smash Button Container */
.erp-mobile-controls-row {
  display: none;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.btn-mobile-smash {
  padding: 12px 28px;
  border-radius: 30px;
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 900;
  border: 2px solid #FCA5A5;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mobile-smash:active {
  transform: scale(0.94);
  background: #DC2626;
}

/* D-Pad Buttons for Mobile */
.mobile-dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  grid-template-rows: repeat(2, 38px);
  gap: 4px;
}

.dpad-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.dpad-btn:active {
  background: rgba(239, 68, 68, 0.4);
  border-color: #EF4444;
}

/* --------------------------------------------------------------------------
   STAGE CLEAR OVERLAY
   -------------------------------------------------------------------------- */
.erp-stage-clear-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 2, 5, 0.92);
  backdrop-filter: blur(10px);
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.erp-stage-clear-overlay.show {
  display: flex;
}

/* --------------------------------------------------------------------------
   THE GRAND VICTORY CERTIFICATE (PERSONALIZED CORPORATE KING/QUEEN)
   -------------------------------------------------------------------------- */
.erp-victory-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 1, 3, 0.96);
  backdrop-filter: blur(14px);
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.erp-victory-modal.show {
  display: flex;
}

.corporate-certificate-card {
  background: linear-gradient(180deg, #180C10 0%, #0C0508 100%);
  border: 2px solid #F59E0B;
  border-radius: 24px;
  padding: 28px 32px;
  max-width: 580px;
  width: 95%;
  position: relative;
  box-shadow: 
    0 25px 70px rgba(0, 0, 0, 0.95),
    0 0 50px rgba(245, 158, 11, 0.35);
  text-align: center;
}

.cert-stamp {
  position: absolute;
  top: 20px;
  right: 24px;
  border: 2px dashed #EF4444;
  color: #EF4444;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 6px;
  transform: rotate(12deg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cert-header-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.cert-title {
  font-family: var(--font-display, var(--font-heading));
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 900;
  color: #F59E0B;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cert-subtitle {
  font-size: 0.82rem;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.cert-employee-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 18px;
}

.cert-emp-name {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.cert-emp-role {
  font-size: 0.8rem;
  font-weight: 800;
  color: #38BDF8;
  text-transform: uppercase;
}

.cert-verdict-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #CBD5E1;
  line-height: 1.5;
  margin-bottom: 20px;
}

.cert-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .erp-arena-stage {
    height: 360px;
  }
  .erp-mobile-controls-row {
    display: flex;
  }
  .erp-instructions-pill {
    display: none;
  }
}
