/**
 * Rooster Run - Game Styles
 * Espolón Brand Edition
 */

/* === FONTS === */
@font-face {
  font-family: 'Espolon BT Display';
  src: url('https://corsproxy.io/?url=https://www.espolontequila.com/app/themes/campari-wdf/includes/extensions/fonts/Espolon/Espolon-BT-Display/Espolon-BT-Display.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Espolon BT Sans';
  src: url('https://corsproxy.io/?url=https://www.espolontequila.com/app/themes/campari-wdf/includes/extensions/fonts/Espolon/Espolon-BT-Sans/Espolon-BT-Sans.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* === CSS VARIABLES === */
:root {
  --espolon-pink: #F03893;
  --espolon-lime: #D6FF00;
  --espolon-orange: #FF9900;
  --espolon-black: #1a1a1a;
  --espolon-white: #FFFFFF;
}

/* === BASE RESET === */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--espolon-black);
  overflow: hidden;
  touch-action: none;
  font-family: 'Espolon BT Sans', 'Helvetica Neue', Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  color: var(--espolon-white);
}

/* Display font for titles */
h1, h2, .hud-text, #countdown-overlay, #game-over h1, .display-font {
  font-family: 'Espolon BT Display', serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* === GAME CONTAINER === */
#game-container {
  position: relative;
  background-color: var(--espolon-white);
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  border: 4px solid var(--espolon-pink);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* === UI LAYERS === */
#ui-layer,
#generator-overlay,
#loading-overlay,
#game-over,
#countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* === HUD LAYER === */
#ui-layer {
  pointer-events: none;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 4%;
  z-index: 10;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.hud-text {
  color: var(--espolon-black);
  font-size: 6vmin;
  text-shadow: 
    2px 2px 0 var(--espolon-white),
    -2px -2px 0 var(--espolon-white),
    2px -2px 0 var(--espolon-white),
    -2px 2px 0 var(--espolon-white);
}

.hud-sub {
  font-size: 3.5vmin;
  color: var(--espolon-pink);
  margin-top: 0.5vmin;
  font-weight: bold;
  text-shadow: 1px 1px 0 var(--espolon-white);
  font-family: 'Espolon BT Sans', sans-serif;
}

/* === GENERATOR OVERLAY === */
#generator-overlay {
  background: rgba(26, 26, 26, 1.0);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  touch-action: manipulation;
}

.ui-panel {
  background-color: transparent;
  color: var(--espolon-white);
  border-radius: 0;
}

/* Custom File Input */
.file-input-label {
  background-color: var(--espolon-pink);
  color: var(--espolon-white);
  font-family: 'Espolon BT Display', serif;
  text-transform: uppercase;
  padding: 1rem 2rem;
  cursor: pointer;
  display: inline-block;
  transition: all 0.2s;
  border: 2px solid var(--espolon-pink);
  font-size: 1.2rem;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.file-input-label:hover {
  background-color: var(--espolon-white);
  color: var(--espolon-pink);
  border-color: var(--espolon-white);
}

/* Flat Buttons */
.btn-flat {
  font-family: 'Espolon BT Display', serif;
  text-transform: uppercase;
  padding: 1rem;
  border: 3px solid var(--espolon-pink);
  background-color: transparent;
  color: var(--espolon-pink);
  transition: all 0.2s;
  border-radius: 0;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.btn-flat:hover {
  background-color: var(--espolon-pink);
  color: var(--espolon-white);
}

.btn-flat:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #333;
  border-color: #555;
  color: #777;
}

.btn-flat-primary {
  background-color: var(--espolon-pink);
  color: var(--espolon-white);
}

.btn-flat-primary:hover {
  background-color: var(--espolon-white);
  color: var(--espolon-pink);
  border-color: var(--espolon-white);
}

/* === LOADING OVERLAY === */
#loading-overlay {
  background: var(--espolon-black);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 100;
  transition: opacity 0.5s;
  border: 4px solid var(--espolon-pink);
}

.spinner {
  width: 10vmin;
  height: 10vmin;
  border: 1.5vmin solid rgba(240, 56, 147, 0.3);
  border-top: 1.5vmin solid var(--espolon-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 4vmin;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === GAME OVER === */
#game-over {
  background: rgba(26, 26, 26, 0.95);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  pointer-events: auto;
  touch-action: manipulation;
  cursor: pointer;
  border: 4px solid var(--espolon-pink);
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

#game-over.visible {
  opacity: 1;
}

#game-over h1 {
  margin: 0 0 4% 0;
  font-size: 14vmin;
  color: var(--espolon-pink);
  text-shadow: 4px 4px 0 var(--espolon-black);
  line-height: 0.9;
}

#game-over p {
  margin: 1% 0;
  font-size: 6vmin;
  color: var(--espolon-white);
  font-family: 'Espolon BT Display', serif;
}

/* === COUNTDOWN === */
#countdown-overlay {
  background: transparent;
  display: none;
  z-index: 15;
  pointer-events: none;
  justify-content: center;
  align-items: center;
  font-size: 40vmin;
  color: var(--espolon-pink);
  text-shadow: 5px 5px 0 var(--espolon-black);
  padding-bottom: 15%;
}

/* === ANIMATIONS === */
.blink {
  animation: blinker 1.5s linear infinite;
}

@keyframes blinker {
  50% { opacity: 0; }
}

/* Progress Bar */
.progress-bar {
  transition: width 0.3s ease-out;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .hud-text {
    font-size: 5vmin;
  }
  
  .hud-sub {
    font-size: 3vmin;
  }
}
