
    /* ==========================================
       1. GRUNDSTIL & INTERFACE
       ========================================== */
    #loading-screen {
      position: fixed;
      top: 0; left: 0;
      width: 100vw; height: 100vh;
      background: radial-gradient(circle at center, #1e130c 0%, #050302 100%);
      z-index: 9999; 
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      transition: opacity 0.5s ease, transform 0.5s ease;
    }

    .loader-spinner {
      width: 50px; height: 50px;
      border: 5px solid #3d2516;
      border-top: 5px solid #ffaa00;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      box-shadow: 0 0 15px rgba(255, 170, 0, 0.2);
      margin-bottom: 20px;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    body { 
      font-family: 'Courier New', monospace; 
      background-color: #000; 
      color: #fff; 
      margin: 0;
      padding: 0;
      overflow: hidden;
      height: 100vh;
      display: flex;
      flex-direction: column;
    }

    h1, h2, h3 {
      margin: 0;
      text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }

    .hidden {
      display: none !important;
    }

    /* --- LAN-YTA / SALOON --- */
    .saloon-floor.lan-sleeping {
      filter: brightness(0.3) contrast(1.2) drop-shadow(0 0 15px rgba(0,0,255,0.2));
      transition: filter 1s ease;
    }
    .saloon-container {
      flex: 1;
      position: relative;
      background-color: #14100f;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .saloon-floor {
      width: 1000px;
      height: 550px;
      background-image: url('../images/floor.png');
      background-size: 100% 100%;
      background-repeat: no-repeat;
      border: 6px solid #2e1f0e;
      box-shadow: inset 0 0 40px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
      position: relative;
      overflow: hidden; 
    }

    /* Klick-zon anpassad efter din nya disks storlek och position */
    #saloon-counter-zone {
      position: absolute;
      width: 315px; 
      height: 260px;
      left: 685px; 
      top: 237px;  
      z-index: 5; 
      cursor: pointer;
      pointer-events: auto;
    }

    .saloon-character {
      position: absolute;
      width: 100px;
      height: 120px;
      background-image: url('../character sheet.png');
      background-repeat: no-repeat;
      background-size: 600px 840px;
      image-rendering: pixelated;
      transform: scale(0.6);
      transform-origin: bottom center;
      transition: left 4s linear, top 4s linear, filter 0.3s ease;
      cursor: pointer;
    }

    /* --- POPUP-KNAPPAR --- */
    .popup-card-style-btn {
      background: #1e272e;
      color: #ffffff;
      border: 3px solid #ffffff !important; 
      border-radius: 12px; 
      padding: 12px 28px;
      font-family: 'Courier New', monospace;
      font-size: 1rem;
      font-weight: bold;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.5);
      transition: all 0.2s ease;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    .popup-card-style-btn.accept-glow {
      color: #00ffcc;
      border-color: #00ffcc !important;
    }
    .popup-card-style-btn.accept-glow:hover {
      background: #00ffcc;
      color: #14100f;
      box-shadow: 0 0 20px rgba(0, 255, 204, 0.6);
      transform: translateY(-2px);
    }

    .popup-card-style-btn.cancel-glow {
      color: #ffaa00;
      border-color: #ffaa00 !important;
    }
    .popup-card-style-btn.cancel-glow:hover {
      background: #ffaa00;
      color: #14100f;
      box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
      transform: translateY(-2px);
    }

    .popup-card-style-btn:active {
      transform: translateY(1px);
    }
    
    /* --- PARTIKLAR (KONFETTI / MYNT) --- */
    .confetti-particle {
      position: absolute;
      width: 6px;
      height: 6px;
      z-index: 250; 
      pointer-events: none;
      border-radius: 1px;
      animation: confetti-fall 0.8s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    }

    @keyframes confetti-fall {
      0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
      100% { transform: translate(var(--dx), var(--dy)) scale(0.5) rotate(var(--dr)); opacity: 0; }
    }

    .coin-particle {
      position: absolute;
      width: 10px;
      height: 10px;
      background-color: #ffd700;
      border: 1px solid #d4af37;
      border-radius: 50%; 
      z-index: 250;
      pointer-events: none;
      box-shadow: 1px 1px 3px rgba(0,0,0,0.4), inset -1px -1px 2px #b8860b;
      animation: coin-splash 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    }

    @keyframes coin-splash {
      0% { transform: translate(0, 0) scale(1) rotateX(0deg); opacity: 1; }
      100% { transform: translate(var(--dx), var(--dy)) scale(0.7) rotateX(720deg); opacity: 0; }
    }

    /* Pratbubblor */
    .speech-bubble {
      display: none;
      position: absolute;
      bottom: 125px; 
      left: 50%;
      transform: translateX(-50%) scaleX(1.6) scaleY(1.6);
      background: #ffffff;
      color: #000000;
      border: 2px solid #000000;
      padding: 6px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: bold;
      white-space: nowrap;
      z-index: 100;
      box-shadow: 3px 3px 0px rgba(0,0,0,0.3);
    }

    .saloon-character[style*="scale(-0.6"] .speech-bubble {
      transform: translateX(-50%) scaleX(-1.6) scaleY(1.6);
    }

    .speech-bubble::after {
      content: '';
      position: absolute;
      bottom: -6px;
      left: 50%;
      transform: translateX(-50%);
      border-width: 6px 6px 0;
      border-style: solid;
      border-color: #ffffff transparent;
      display: block;
      width: 0;
    }

    /* ==========================================
       2. DIABLO II HUD
       ========================================== */
    .diablo-hud {
      height: 160px;
      background: radial-gradient(circle at center, #2c1e14 0%, #120a06 100%);
      border-top: 4px solid #5a3d28;
      box-shadow: inset 0 10px 20px rgba(0,0,0,0.8), 0 -15px 35px rgba(0,0,0,0.9);
      display: flex;
      justify-content: center; 
      align-items: center;
      gap: 30px; 
      padding: 0 40px;
      z-index: 10;
      position: relative;
    }

    .diablo-hud::before {
      content: '';
      position: absolute;
      top: 0; left: 0; width: 100%; height: 2px;
      background: linear-gradient(to right, transparent, #ffaa00, transparent);
      opacity: 0.4;
    }

    .hud-portrait-box {
      width: 116px;
      height: 136px;
      background: #090604;
      border: 4px solid #3d2516;
      outline: 2px solid #1a0f09;
      border-radius: 4px;
      box-shadow: inset 0 0 20px #000, 0 5px 15px rgba(0,0,0,0.6);
      display: flex;
      justify-content: center;
      align-items: center;
      margin-right: 5px; 
    }

    .hud-portrait {
      width: 100px;
      height: 120px;
      background-image: url('../character sheet.png');
      background-repeat: no-repeat;
      background-size: 600px 840px;
      image-rendering: pixelated;
    }

    .hud-hotbar {
      flex: 1;
      max-width: 580px;
      text-align: center;
      background: linear-gradient(135deg, #1e130c 0%, #110905 100%);
      border: 3px solid #4a3120;
      border-image: linear-gradient(to bottom, #5a3d28, #2a160c) 1;
      box-shadow: inset 0 0 15px rgba(0,0,0,0.9), 0 4px 10px rgba(0,0,0,0.5);
      padding: 10px 16px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .hud-hotbar h3 {
      color: #ffaa00;
      text-transform: uppercase;
      letter-spacing: 2px;
      font-size: 1.1rem;
      font-family: 'Georgia', serif;
      text-shadow: 2px 2px 4px #000, 0 0 8px rgba(255,170,0,0.3);
      margin-bottom: -2px;
    }

    .hud-inventory-container {
      display: flex;
      align-items: center;
      gap: 15px;
      width: 100%;
      justify-content: center;
    }

    .hud-slots-row {
      display: flex;
      gap: 10px; 
    }

    .inventory-slot {
      width: 52px;
      height: 68px;
      background: radial-gradient(circle at center, #150f0b 0%, #080503 100%);
      border: 2px solid #2d1e15;
      border-top-color: #1a110c; 
      border-left-color: #1a110c;
      box-shadow: inset 3px 3px 8px rgba(0,0,0,0.8), 0 1px 2px rgba(255,255,255,0.05);
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
      border-radius: 2px;
    }

    .inventory-slot:hover {
      border-color: #ffaa00;
      box-shadow: inset 0 0 5px rgba(0,0,0,0.8), 0 0 12px rgba(255,170,0,0.6);
      transform: translateY(-2px);
    }

    .inventory-slot img {
      width: 85%;
      height: 85%;
      object-fit: contain;
      image-rendering: pixelated;
      filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5));
    }

    .hud-status-text {
      font-size: 0.9em;
      font-weight: bold;
      letter-spacing: 1px;
      text-shadow: 1px 1px 3px #000;
    }

    .hud-orb-box {
      width: 116px;
      height: 116px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-left: 5px; 
    }

    .hud-orb {
      width: 104px;
      height: 104px;
      background: #050508;
      border: 4px solid #3d2516;
      outline: 2px solid #1a0f09;
      border-radius: 50%;
      position: relative;
      overflow: hidden;
      box-shadow: 0 6px 15px rgba(0,0,0,0.7), inset 0 0 25px #000;
    }

    .hud-orb-glass {
      content: '';
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 40%, rgba(0,0,0,0.5) 100%);
      pointer-events: none;
      z-index: 3;
      border-radius: 50%;
    }

    /* ==========================================
       3. PACK OPENING SCREEN
       ========================================== */
    .pack-shop-overlay {
      flex: 1;
      background-color: #141a1e;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      gap: 20px;
      padding: 30px 0;
    }

    .shop-container {
      background: rgba(0, 0, 0, 0.7);
      padding: 30px;
      border-radius: 20px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.5);
      border: 2px solid rgba(255,255,255,0.1);
    }

    .packs-row {
      display: flex;
      flex-direction: row;
      gap: 30px;
      justify-content: center;
      align-items: flex-start;
    }

    .pack-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      width: 140px;
      transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .pack-img {
      width: 100%;
      height: auto;
      cursor: pointer;
      filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    }

    .pack-wrapper:not(.locked):hover {
      transform: translateY(-10px) scale(1.05);
    }

    .pack-label {
      color: white;
      font-size: 0.85rem;
      font-weight: bold;
      text-align: center;
    }

    .pack-wrapper.locked {
      opacity: 0.15;
      filter: grayscale(100%);
      cursor: not-allowed;
      pointer-events: none;
    }

    .pack-container {
      display: flex;
      flex-direction: row;
      gap: 20px;
      justify-content: center;
      align-items: center;
      padding: 20px;
      width: 100%;
      min-height: 250px;
      box-sizing: border-box;
    }

    /* ==========================================
       4. KORTANIMATIONER & HOLO-EFFEKTER
       ========================================== */
    .card-container {
      perspective: 1200px;
      width: 160px;
      height: 230px;
      position: relative;
      opacity: 0;
      transform: translateY(-150px) scale(0.3) rotateX(-30deg);
      transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
      z-index: 1;
      flex-shrink: 0;
    }

    .card-container.dealt {
      opacity: 1;
      transform: translateY(0) scale(1) rotateX(0deg);
    }

    .card-container.chosen {
      z-index: 100;
      transform: scale(1.6) translateZ(80px) !important;
    }

    .card {
      width: 100%;
      height: 100%;
      position: relative;
      transform-style: preserve-3d;
      transition: transform 0.3s ease-out, opacity 0.5s ease;
      cursor: pointer;
      border-radius: 15px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    }

    .card.chosen-flip {
      transform: rotateY(180deg);
      transition: transform 0.4s ease-out !important; 
    }

    .card.reveal-loser {
      opacity: 0.25;
    }

    .card.reveal-loser .card-back {
      display: none !important;
    }

    .card-front, .card-back {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      backface-visibility: hidden !important;
      -webkit-backface-visibility: hidden !important;
      border-radius: 15px;
      box-sizing: border-box;
      border: 5px solid #ffffff !important;
    }

    .card-front {
      transform: rotateY(180deg);
      overflow: hidden;
      background-color: #1e272e;
    }

    .card.reveal-loser .card-front {
      transform: rotateY(0deg);
    }

    .card-front-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .card-back {
      background: #1b2631;
      overflow: hidden;
    }

    .card-back-image { 
      width: 100%; height: 100%; object-fit: cover; 
    }

    .card-foil-glow {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      pointer-events: none; opacity: 0; transition: opacity 0.5s ease;
    }

    .is-common.chosen .card-front::after {
      content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      background-image: linear-gradient(115deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) var(--mouse-foil-x, 50%), rgba(255,255,255,0) 100%);
      mix-blend-mode: overlay;
    }

    .is-rarity-3.chosen .card-front::after {
      content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      background-image: radial-gradient(circle at var(--mouse-foil-x, 50%) var(--mouse-foil-y, 50%), rgba(255,255,255,0.6) 0%, rgba(0,0,0,0) 70%);
      mix-blend-mode: screen;
    }

    .card-back-holo {
      position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      background-image: radial-gradient(circle at var(--back-foil-x, 50%) var(--back-foil-y, 50%), rgba(255,255,255,0.9) 0%, rgba(255,0,128,0.4) 40%, rgba(255,255,255,0) 70%);
      mix-blend-mode: overlay; opacity: 0; transition: opacity 0.3s ease-out;
    }

    .is-rarity-4.chosen .card-logo-holo,
    .is-golden.chosen .card-logo-holo {
      opacity: 0.3; 
    }

    .card-logo-holo {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.5s ease;
      z-index: 11;
      mix-blend-mode: screen; 
      border-radius: 15px;
      overflow: hidden;
    }

    .card-logo-holo::before {
      content: "";
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background-image: radial-gradient(
        circle at var(--mouse-foil-x, 50%) var(--mouse-foil-y, 50%),
        #ff0080 0%, #00ffff 15%, #ffe600 30%, #00ff00 45%, #000000 70%
      );
      background-size: 100% 100%; 
    }

    .is-golden.chosen .card-logo-holo::before {
      background-image: radial-gradient(
        circle at var(--mouse-foil-x, 50%) var(--mouse-foil-y, 50%),
        #ffffff 0%, #ffe600 15%, #d4af37 35%, #aa7c11 55%, #000000 90%
      );
    }

    .card-logo-holo::after {
      content: "";
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      background-image: url('../images/glitter.png');
      background-repeat: no-repeat;
      background-size: 100% 100%; 
      background-position: center;
      mix-blend-mode: multiply; 
    }
    
    .player-btn {
      background: #3d2516;
      color: #ffaa00;
      border: 2px solid #5a3d28;
      padding: 8px 16px;
      cursor: pointer;
      font-weight: bold;
      border-radius: 4px;
    }
    .player-btn:hover {
      background: #5a3d28;
      color: #fff;
    }
  

.loading-title {
  color: #ffaa00;
  font-family: '"'"'Georgia'"'"', serif;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px #000;
}

.loading-copy {
  color: #66442c;
  font-size: 0.9rem;
  margin-top: 10px;
}

.sleep-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9995;
  background: rgba(0, 0, 50, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.sleep-overlay-title {
  color: #66ccff;
  font-family: '"'"'Georgia'"'"', serif;
  letter-spacing: 5px;
  margin-bottom: 20px;
  text-shadow: 0 0 15px rgba(0,110,255,0.6);
}

.sleep-overlay-button {
  font-size: 1.2rem;
  padding: 15px 40px;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
}

.shop-title {
  color: #ffaa00;
}

.pack-status-text {
  margin-bottom: 10px;
}

.consume-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 9990;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
}

.consume-dialog {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 90vh;
  max-height: 720px;
  padding: 10px 20px;
  box-sizing: border-box;
}

.consume-title {
  color: #ffaa00;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 20px 0 0;
  font-family: '"'"'Georgia'"'"', serif;
  text-shadow: 0 0 10px rgba(255,170,0,0.5);
}

.consume-card-frame {
  width: 240px;
  height: 340px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.consume-actions {
  display: flex;
  gap: 25px;
  margin-bottom: 30px;
}

.sleep-btn {
  height: 40px;
  align-self: center;
  border-color: #66ccff;
  color: #66ccff;
}

.hud-orb-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.thirst-fluid-group {
  transition: transform 0.5s ease;
}

.card-logo-holo.is-visible {
  opacity: 0.4;
}

.card-container.popup-card {
  opacity: 1;
  width: 224px;
  height: 322px;
}

.card.popup-card-face {
  transform: rotateY(180deg);
  transition: transform 0.1s ease-out;
}
