/* ==========================================================================
   FS CRUSH IT - HYDRAULIC PRESS ASMR DESTRUCTION STYLESHEET
   Unified Scaled Viewport Standard (Mobile, iPad, PC)
   ========================================================================== */

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --bg-dark: #070a12;
  --bg-card: rgba(14, 20, 36, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 77, 109, 0.5);

  --text-main: #f0f4fc;
  --text-muted: #8ca0be;

  --neon-crimson: #ff3366;
  --glow-crimson: rgba(255, 51, 102, 0.45);
  --neon-orange: #ff8531;
  --neon-gold: #ffd700;
  --neon-cyan: #00f3ff;
  --neon-emerald: #00e626;

  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.65);
}

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

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% 15%, #181d2e 0%, #060912 100%);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 6px 16px;
  overflow-x: hidden;
  touch-action: manipulation;
}

.game-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==========================================================================
   Compact Single-Row Header
   ========================================================================== */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 0.35rem 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.back-btn {
  text-decoration: none;
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--neon-crimson);
}

.title-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
}

.title-badge .crush-icon {
  display: inline-block;
  font-size: 1.1rem;
  animation: pulseIcon 1.8s infinite ease-in-out;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-chip {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-chip strong {
  color: var(--neon-crimson);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
}

/* ==========================================================================
   Material Selector Chips Bar
   ========================================================================== */
.material-bar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.25rem 0.1rem;
  scrollbar-width: none;
}

.material-bar::-webkit-scrollbar {
  display: none;
}

.mat-chip-btn {
  flex: 1;
  min-width: 95px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.4rem 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mat-chip-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.mat-chip-btn.active {
  border-color: var(--neon-crimson);
  background: rgba(255, 51, 102, 0.18);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Compact Controls Toolbar
   ========================================================================== */
.controls-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 0.3rem 0.5rem;
  gap: 0.4rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  height: 30px;
  padding: 0 0.55rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--neon-crimson);
}

.glass-btn.icon-btn {
  width: 30px;
  padding: 0;
}

.glass-btn.active {
  border-color: var(--neon-crimson);
  background: rgba(255, 51, 102, 0.15);
  color: var(--neon-crimson);
}

.donate-pill-btn {
  background: rgba(0, 229, 163, 0.12) !important;
  border: 1px solid rgba(0, 229, 163, 0.4) !important;
  color: #00e5a3 !important;
  border-radius: 16px !important;
  padding: 0 0.55rem !important;
  font-size: 0.72rem !important;
}

/* ==========================================================================
   Maximized Canvas Play Area (55vh - 65vh standard)
   ========================================================================== */
.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  height: 62vh;
  height: 62dvh;
  max-height: 560px;
  background: radial-gradient(circle at 50% 40%, #151d30 0%, #060912 100%);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
  cursor: pointer;
}

canvas#crush-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Screen Shake Effect */
.canvas-wrapper.shake {
  animation: screenShake 0.25s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

/* HUD Overlay Prompts */
.hud-prompt {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 12, 24, 0.9);
  border: 1px solid rgba(255, 77, 109, 0.4);
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.25);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  white-space: nowrap;
}

.hud-crush-counter {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(7, 12, 24, 0.92);
  border: 1px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.25);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 10;
}

.hud-crush-counter strong {
  color: var(--neon-gold);
  font-family: var(--font-heading);
  font-size: 1rem;
}

/* ==========================================================================
   Complete Annihilation / New Object Modal
   ========================================================================== */
.canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 25;
  transition: opacity 0.3s ease;
}

.canvas-overlay.hidden {
  display: none !important;
}

.overlay-card {
  background: rgba(14, 22, 42, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1.25rem 1.1rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.crush-badge-circle {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 51, 102, 0.3) 0%, rgba(14, 22, 42, 0.8) 100%);
  border: 2px solid var(--neon-crimson);
  box-shadow: 0 0 24px var(--glow-crimson);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: pulseScore 1.8s infinite ease-in-out;
}

@keyframes pulseScore {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px var(--glow-crimson); }
  50% { transform: scale(1.06); box-shadow: 0 0 32px var(--neon-crimson); }
}

.crush-badge-circle .crush-icon-big {
  font-size: 2rem;
  line-height: 1;
}

.crush-badge-circle .score-label {
  font-size: 0.65rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.result-feedback {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.overlay-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.btn-action-primary {
  flex: 1;
  background: linear-gradient(135deg, #ff3366, #e6004c);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--glow-crimson);
  transition: all 0.2s ease;
}

.btn-action-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow-crimson);
}

.btn-action-secondary {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
}

/* ==========================================================================
   Dedicated Heavy Hydraulic Lever / Trackpad
   (Unified Multi-Device Standard)
   ========================================================================== */
.mobile-touch-bar {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0.6rem;
  align-items: center;
  gap: 0.5rem;
  touch-action: none;
}

.touch-bar-handle {
  flex: 1;
  height: 48px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px dashed rgba(255, 51, 102, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0 0.8rem;
  cursor: ns-resize;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.touch-bar-handle:active,
.touch-bar-handle.active {
  background: rgba(255, 51, 102, 0.18);
  border-color: var(--neon-crimson);
  border-style: solid;
  box-shadow: inset 0 0 16px rgba(255, 51, 102, 0.3);
}

.touch-track-groove {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 51, 102, 0.5), transparent);
}

.touch-arrow {
  color: var(--neon-crimson);
  font-size: 0.85rem;
  font-weight: 800;
}

.touch-bar-label {
  font-size: 0.74rem;
  color: #ffccd5;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.touch-action-btn {
  width: 56px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 51, 102, 0.5);
  background: linear-gradient(135deg, #ff3366, #b0003a);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--glow-crimson);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.touch-action-btn:active {
  transform: scale(0.92);
}

.touch-btn-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.touch-btn-text {
  font-size: 0.62rem;
  font-weight: 800;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Responsive Scaling for Tablet / iPad & PC
   ========================================================================== */
@media (min-width: 651px) and (max-width: 1024px) {
  body {
    padding: 12px 10px;
  }
  .game-container {
    max-width: 680px;
    gap: 8px;
  }
  .canvas-wrapper {
    height: 560px;
    height: 64vh;
    height: 64dvh;
    max-height: 680px;
  }
}

@media (min-width: 1025px) {
  body {
    padding: 16px 12px;
  }
  .game-container {
    max-width: 680px;
    gap: 8px;
  }
  .canvas-wrapper {
    height: 580px;
    height: 65vh;
    height: 65dvh;
    max-height: 720px;
  }
}
