/* Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

:root {
  --bg-color: hsl(220, 25%, 8%);
  --panel-bg: hsla(220, 25%, 15%, 0.7);
  --border-color: hsla(0, 0%, 100%, 0.15);
  --accent-red: hsl(355, 85%, 50%);
  --accent-red-glow: hsla(355, 85%, 50%, 0.4);
  --accent-gold: hsl(45, 100%, 50%);
  --accent-gold-glow: hsla(45, 100%, 50%, 0.4);
  --text-primary: hsl(220, 100%, 95%);
  --text-secondary: hsl(220, 15%, 70%);
  --retro-font: 'Orbit', sans-serif;
  --title-font: 'Black Han Sans', sans-serif;
  --pixel-font: 'Press Start 2P', monospace;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--retro-font);
  overflow: hidden;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(circle at center, hsl(220, 25%, 14%) 0%, var(--bg-color) 80%);
}

/* Main Container */
#app-container {
  position: relative;
  width: 450px;
  height: 800px;
  background: black;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-color);
}

/* Screens Common */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.screen.active {
  display: flex;
}

/* Glassmorphism utility */
.glassmorphism {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Start Screen Styling */
#start-screen {
  background: linear-gradient(135deg, hsl(220, 30%, 6%) 0%, hsl(220, 25%, 12%) 100%);
  padding: 30px;
  text-align: center;
}

.logo-container {
  margin-bottom: 25px;
  animation: float 4s ease-in-out infinite;
}

.game-title {
  font-family: var(--title-font);
  font-size: 56px;
  color: var(--accent-red);
  text-shadow: 0 0 10px var(--accent-red-glow), 0 4px 0 hsl(355, 85%, 25%), 0 8px 15px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.game-subtitle {
  font-size: 18px;
  color: var(--accent-gold);
  text-shadow: 0 0 8px var(--accent-gold-glow);
  font-weight: bold;
  letter-spacing: 4px;
  margin-top: 5px;
}

.menu-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  z-index: 5;
}

.difficulty-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.difficulty-section h3 {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.difficulty-options {
  display: flex;
  gap: 10px;
}

.diff-btn {
  background: hsla(220, 20%, 20%, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--retro-font);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.diff-btn:hover {
  background: hsla(220, 20%, 30%, 0.8);
  color: var(--text-primary);
}

.diff-btn.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: white;
  box-shadow: 0 0 12px var(--accent-red-glow);
  font-weight: bold;
}

/* Buttons */
.action-btn {
  font-family: var(--title-font);
  font-size: 22px;
  background: linear-gradient(180deg, var(--accent-gold) 0%, hsl(45, 100%, 35%) 100%);
  color: black;
  border: none;
  padding: 12px 36px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 6px 0 hsl(45, 100%, 20%), 0 10px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  outline: none;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 hsl(45, 100%, 20%), 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-gold-glow);
}

.action-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 hsl(45, 100%, 20%), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Controls Guide */
.controls-guide {
  background: hsla(220, 20%, 6%, 0.5);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  width: 100%;
  max-width: 740px;
  text-align: left;
}

.controls-guide h3 {
  font-size: 13px;
  color: var(--accent-gold);
  margin-bottom: 8px;
  text-align: center;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

kbd {
  background-color: #333;
  border: 1px solid #555;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 0 0 2px #222 inset;
  color: #eee;
  display: inline-block;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.4;
  margin: 0 1px;
  padding: 1px 4px;
  text-shadow: 0 1px 0 #000;
}

.footer-credit {
  position: absolute;
  bottom: 8px;
  font-size: 10px;
  color: hsla(220, 10%, 50%, 0.5);
  font-family: var(--retro-font);
}

/* Game Canvas Screen */
#game-screen {
  background: #1a1a1a;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #222;
}

/* HUD / UI Overlay */
#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let canvas capture mouse clicks if any, though keyboard-based */
  z-index: 20;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

/* Player Status Glass Box */
.player-status {
  display: flex;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 8px;
  gap: 10px;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.avatar-box {
  width: 44px;
  height: 44px;
  background: #333;
  border: 2px solid var(--accent-gold);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* Programmatic avatar face state classes */
#player-avatar {
  width: 100%;
  height: 100%;
  background-size: cover;
  image-rendering: pixelated;
}

/* Canvas drawing acts as background for avatar box via JS drawing or static shapes,
   so we can styled avatar states via CSS classes if we want, or draw it on Canvas.
   We will draw Hong Myung-bo's face on canvas, but let's draw it dynamically on CSS */
.avatar-normal {
  background-image: url('assets/hong_normal.png');
}
.avatar-hurt {
  background-image: url('assets/hong_hurt.png') !important;
  animation: shake 0.2s infinite;
}
.avatar-critical {
  background-image: url('assets/hong_critical.png') !important;
}

.status-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-label {
  font-family: var(--pixel-font);
  font-size: 9px;
  width: 32px;
  color: var(--text-primary);
  text-align: right;
}

.hp-bar-outer {
  width: 150px;
  height: 14px;
  background: #111;
  border: 1px solid #444;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

#hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-red) 0%, hsl(10, 95%, 45%) 100%);
  width: 100%;
  transition: width 0.1s ease-out;
}

#hp-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel-font);
  font-size: 7px;
  color: white;
  text-shadow: 1px 1px 0 black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black;
}

.rage-bar-outer {
  width: 150px;
  height: 12px;
  background: #111;
  border: 1px solid #444;
  border-radius: 3px;
  position: relative;
}

#rage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(200, 100%, 50%) 0%, var(--accent-gold) 100%);
  width: 0%;
  transition: width 0.1s ease-out;
}

.rage-dots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

.rage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #222;
  border: 1px solid #555;
  transition: background 0.2s, box-shadow 0.2s;
}

.rage-dot.active {
  background: var(--accent-gold);
  border-color: #fff;
  box-shadow: 0 0 6px var(--accent-gold);
}

.game-meta {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: right;
  font-family: var(--pixel-font);
  font-size: 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#stage-display {
  color: var(--accent-gold);
  letter-spacing: 1px;
}

#score-display {
  color: #fff;
}

/* Inventory Icons */
#inventory-overlay {
  position: absolute;
  bottom: 15px;
  left: 15px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.inv-slot {
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #444;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: scaleUp 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.inv-slot.trap {
  border-color: var(--accent-red);
}

.inv-slot-count {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: var(--accent-gold);
  color: black;
  font-family: var(--pixel-font);
  font-size: 7px;
  font-weight: bold;
  padding: 1px 3px;
  border-radius: 3px;
}

/* Boss HUD at Top Center */
#boss-hud {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--accent-red);
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.boss-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#boss-name {
  font-family: var(--title-font);
  font-size: 12px;
  color: #fff;
  text-shadow: 0 0 4px var(--accent-red-glow);
}

.boss-hp-outer {
  width: 100%;
  height: 8px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #333;
}

#boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3300 0%, #b30000 100%);
  width: 100%;
  transition: width 0.1s ease-out;
}

/* Go indicator */
#go-indicator {
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel-font);
  font-size: 16px;
  color: var(--accent-gold);
  text-shadow: 0 0 10px var(--accent-gold-glow);
  animation: go-blink-vertical 0.6s infinite alternate;
}

/* Quiz Overlay Styling */
#quiz-overlay {
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.quiz-box {
  width: 90%;
  max-width: 400px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: pop-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: auto;
}

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

.quiz-header h2 {
  font-family: var(--title-font);
  font-size: 20px;
  color: var(--accent-gold);
  text-shadow: 0 0 8px var(--accent-gold-glow);
}

#quiz-timer {
  font-family: var(--pixel-font);
  font-size: 18px;
  color: var(--accent-red);
  background: #000;
  border: 1px solid #333;
  padding: 4px 8px;
  border-radius: 4px;
  text-shadow: 0 0 8px var(--accent-red-glow);
}

.timer-progress-container {
  width: 100%;
  height: 5px;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
}

#timer-progress-bar {
  height: 100%;
  background: var(--accent-gold);
  transition: width 0.1s linear;
}

#quiz-question {
  font-size: 14px;
  line-height: 1.6;
  font-weight: bold;
  color: #fff;
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-gold);
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.quiz-opt {
  background: hsla(220, 20%, 20%, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  text-align: left;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: var(--retro-font);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.quiz-opt:hover {
  background: hsla(45, 100%, 45%, 0.2);
  border-color: var(--accent-gold);
  transform: translateX(4px);
}

.quiz-opt:active {
  background: var(--accent-gold);
  color: black;
}

/* Quiz Result Container */
.quiz-result {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  text-align: center;
  animation: pop-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.quiz-result.hidden {
  display: none !important;
}

.quiz-result-title {
  font-family: var(--title-font);
  font-size: 20px;
  margin: 0;
}

.quiz-result-title.correct {
  color: var(--accent-gold);
  text-shadow: 0 0 8px var(--accent-gold-glow);
}

.quiz-result-title.incorrect {
  color: var(--accent-red);
  text-shadow: 0 0 8px var(--accent-red-glow);
}

.quiz-comment {
  font-size: 12px;
  line-height: 1.6;
  color: #eee;
  background: rgba(0, 0, 0, 0.4);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.quiz-confirm-btn {
  font-family: var(--retro-font);
  font-size: 13px;
  padding: 10px 24px;
  background: linear-gradient(180deg, var(--accent-gold) 0%, hsl(45, 100%, 35%) 100%);
  color: black;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 0 hsl(45, 100%, 20%);
  transition: transform 0.1s, box-shadow 0.1s;
}

.quiz-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 hsl(45, 100%, 20%), 0 0 10px var(--accent-gold-glow);
}

.quiz-confirm-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 hsl(45, 100%, 20%);
}

/* Popup screens: Game Over & Victory */
#game-over-screen {
  background: rgba(0, 0, 0, 0.9);
  z-index: 100;
}

#victory-screen {
  background: radial-gradient(circle at center, hsla(220, 30%, 15%, 0.95) 0%, rgba(0, 0, 0, 0.95) 80%);
  z-index: 100;
}

.popup-box {
  width: 90%;
  max-width: 400px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: pop-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.popup-box h1 {
  font-family: var(--title-font);
  font-size: 32px;
  letter-spacing: 1px;
}

.text-danger {
  color: var(--accent-red);
  text-shadow: 0 0 15px var(--accent-red-glow);
}

.text-success {
  color: var(--accent-gold);
  text-shadow: 0 0 15px var(--accent-gold-glow);
}

.final-score-lbl {
  font-family: var(--pixel-font);
  font-size: 11px;
  color: var(--text-secondary);
}

.final-score-lbl span {
  color: #fff;
  font-size: 12px;
}

.quote-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 6px;
  width: 100%;
  font-style: italic;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.trophy-display {
  font-size: 64px;
  animation: celebrate 1s ease-in-out infinite alternate;
}

/* Helpers */
.hidden {
  display: none !important;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#disclaimer-overlay {
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
}

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

.disclaimer-box {
  width: 90%;
  max-width: 400px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: pop-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: auto;
  text-align: center;
}

.disclaimer-box h2 {
  font-family: var(--title-font);
  font-size: 22px;
  color: var(--accent-gold);
  text-shadow: 0 0 8px var(--accent-gold-glow);
}

.disclaimer-content {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  text-align: left;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.disclaimer-content p {
  margin-bottom: 12px;
}

.disclaimer-content p:last-child {
  margin-bottom: 0;
}

.disclaimer-content strong {
  color: var(--text-primary);
}

/* Keyframes & Animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

@keyframes shake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes pop-in {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes scaleUp {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes celebrate {
  0% { transform: translateY(0px) rotate(-5deg) scale(1); }
  100% { transform: translateY(-10px) rotate(5deg) scale(1.1); }
}

@keyframes go-blink-vertical {
  0% { opacity: 0.2; transform: translateX(-50%) translateY(0px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(-6px); }
}

.text-animate-blink {
  animation: text-blink 0.8s infinite alternate;
}

@keyframes text-blink {
  0% { opacity: 0.6; text-shadow: 0 0 4px var(--accent-gold-glow); }
  100% { opacity: 1; text-shadow: 0 0 16px var(--accent-gold); }
}

.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite linear;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translate(-30%, -30%) rotate(30deg); }
  100% { transform: translate(50%, 50%) rotate(30deg); }
}

/* Damage Flash Overlay & Critical HP Vignette */
#damage-flash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
}

#damage-flash-overlay.flash {
  animation: damage-flash-anim 0.35s ease-out forwards;
}

#damage-flash-overlay.critical-hp {
  animation: critical-pulse-anim 1.5s infinite ease-in-out alternate;
  opacity: 1;
}

@keyframes damage-flash-anim {
  0% {
    opacity: 1;
    background-color: rgba(255, 0, 0, 0.4);
    box-shadow: inset 0 0 80px rgba(255, 0, 0, 0.9);
  }
  100% {
    opacity: 0;
    background-color: rgba(255, 0, 0, 0);
    box-shadow: inset 0 0 0 rgba(255, 0, 0, 0);
  }
}

@keyframes critical-pulse-anim {
  0% {
    box-shadow: inset 0 0 25px rgba(255, 0, 0, 0.35);
    background-color: rgba(255, 0, 0, 0.03);
  }
  100% {
    box-shadow: inset 0 0 60px rgba(255, 0, 0, 0.7);
    background-color: rgba(255, 0, 0, 0.18);
  }
}

/* HUD Damage Flash & Shake */
.player-status.flash-damage {
  animation: hud-damage-shake 0.3s ease-in-out;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

@keyframes hud-damage-shake {
  0% { transform: translate(2px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-0.5deg); }
  20% { transform: translate(-2px, 0px) rotate(0.5deg); }
  30% { transform: translate(0px, 1px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(0.5deg); }
  50% { transform: translate(-1px, 1px) rotate(-0.5deg); }
  60% { transform: translate(-2px, 0px) rotate(0deg); }
  70% { transform: translate(1px, 1px) rotate(-0.5deg); }
  80% { transform: translate(-1px, -1px) rotate(0.5deg); }
  90% { transform: translate(1px, 1px) rotate(0deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

/* Share Container & Buttons */
.share-container {
  margin-top: 15px;
  background: hsla(220, 20%, 10%, 0.6);
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  border-radius: 8px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.share-container.score-share {
  margin-top: 5px;
  margin-bottom: 5px;
  background: hsla(45, 100%, 10%, 0.3);
  border-color: hsla(45, 100%, 50%, 0.2);
}

.share-title {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--retro-font);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.share-container.score-share .share-title {
  color: var(--accent-gold);
}

.share-group {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.share-btn {
  background: hsla(220, 20%, 20%, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--retro-font);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  display: flex;
  align-items: center;
  gap: 4px;
}

.share-btn:hover {
  transform: translateY(-2px);
  background: hsla(220, 20%, 30%, 0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.share-btn:active {
  transform: translateY(1px);
}

.share-btn.link-btn {
  background: hsla(45, 100%, 45%, 0.2);
  border-color: hsla(45, 100%, 50%, 0.4);
  color: var(--accent-gold);
}

.share-btn.link-btn:hover {
  background: hsla(45, 100%, 45%, 0.35);
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.share-btn.twitter-btn {
  background: rgba(29, 161, 242, 0.15);
  border-color: rgba(29, 161, 242, 0.4);
  color: #1da1f2;
}

.share-btn.twitter-btn:hover {
  background: rgba(29, 161, 242, 0.3);
  border-color: #1da1f2;
  box-shadow: 0 0 10px rgba(29, 161, 242, 0.4);
}

.share-btn.facebook-btn {
  background: rgba(24, 119, 242, 0.15);
  border-color: rgba(24, 119, 242, 0.4);
  color: #1877f2;
}

.share-btn.facebook-btn:hover {
  background: rgba(24, 119, 242, 0.3);
  border-color: #1877f2;
  box-shadow: 0 0 10px rgba(24, 119, 242, 0.4);
}

.share-btn.system-btn {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
  color: #a78bfa;
}

.share-btn.system-btn:hover {
  background: rgba(124, 58, 237, 0.3);
  border-color: #a78bfa;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

/* Toast Notification Styles */
#toast-container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--accent-gold);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--retro-font);
  font-size: 11px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 12px var(--accent-gold-glow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toast-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  white-space: nowrap;
}

.toast.fade-out {
  animation: toast-out 0.4s ease-out forwards;
}

@keyframes toast-in {
  0% { transform: translateY(20px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toast-out {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-15px) scale(0.9); opacity: 0; }
}
