/* Mobile-First Halloween Skattjakt Styles - Compact Game UI */

/* Touch-friendly improvements */
* {
    -webkit-tap-highlight-color: rgba(255, 107, 53, 0.3);
    touch-action: manipulation;
}

/* ✅ FIX: HUD Mobile Styles */
@media (max-width: 768px) {
    
    /* FIX: HUD ska vara kompakt horisontell bar */
    .game-hud {
        position: fixed !important;
top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999 !important;
        background: rgba(10, 10, 10, 0.6) !important;
        backdrop-filter: blur(8px) !important;
padding: 0.8rem 1rem !important;
        border-bottom: 2px solid rgba(255, 107, 53, 0.2) !important;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3) !important;
    }

    .hud-stats {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 1rem !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    align-items: center !important;
    }

    .hud-stat {
     display: flex !important;
        flex-direction: row !important;
  align-items: center !important;
        gap: 0.4rem !important;
      padding: 0.5rem 0.8rem !important;
    background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 20px !important;
      border: 1px solid rgba(255, 255, 255, 0.08) !important;
        font-size: 0.9rem !important;
  font-family: 'Eater', cursive !important;
        transition: all 0.3s ease !important;
     min-width: auto !important;
    backdrop-filter: blur(5px) !important;
 flex: 0 0 auto !important;
    }

    .hud-stat i {
        font-size: 1rem !important;
 }

    .hud-stat span {
     font-size: 1.1rem !important;
      font-weight: bold !important;
    }

    /* Mini radar - compact */
    .mini-radar {
        width: 50px !important;
  height: 50px !important;
        flex-shrink: 0 !important;
    }

    /* Multiplayer button - compact */
    .hud-multiplayer-btn {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
    border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .hud-multiplayer-btn i {
   font-size: 1.2rem !important;
    }

    .player-badge {
        position: absolute !important;
      top: -5px !important;
        right: -5px !important;
   background: #ff6b35 !important;
    border-radius: 50% !important;
        width: 20px !important;
    height: 20px !important;
    display: flex !important;
        align-items: center !important;
     justify-content: center !important;
        font-size: 0.7rem !important;
        font-weight: bold !important;
    }

    /* Container adjustments - add padding for fixed bars */
    .game-container {
        padding: 70px 0.8rem 65px 0.8rem !important;
        max-width: 100%;
    }

    /* Main content area */
    .game-main {
 padding: 0;
        gap: 1rem !important;
    }

    /* Compact game title */
    .game-title {
        font-size: 1.6rem !important;
     margin-bottom: 0.8rem !important;
        padding: 0 !important;
    }

    .game-title .pumpkin-icon img,
    .game-title .ghost-icon img {
      width: 35px !important;
        height: 35px !important;
    }

    /* Rounded game-style cards */
    .riddle-card,
    .clue-card {
        padding: 1.2rem !important;
        margin-bottom: 0;
        border-radius: 20px !important;
        border-width: 3px !important;
    }

    /* Compact text */
    .riddle-number {
        font-size: 0.9rem !important;
    }

 .riddle-text {
        font-size: 1.1rem !important;
      line-height: 1.35;
        margin-bottom: 0.9rem !important;
    }

    .clue-text {
font-size: 1.05rem !important;
   margin-bottom: 0.9rem !important;
    }

  .clue-title {
        font-size: 1.3rem !important;
        margin-bottom: 0.8rem !important;
    }

    .clue-instruction {
        font-size: 0.9rem !important;
        margin-bottom: 0.8rem !important;
    }

    /* Compact input fields */
    .answer-input,
    .clue-input {
        font-size: 0.95rem !important;
        padding: 0.8rem !important;
        border-radius: 15px !important;
      border-width: 2px !important;
      margin-bottom: 0.7rem !important;
  -webkit-appearance: none;
        appearance: none;
        background: rgba(0, 0, 0, 0.7) !important;
    }

    /* Compact buttons */
    .btn {
        font-size: 0.8rem !important;
        padding: 0.55rem 0.9rem !important;
        min-height: 38px !important;
 border-radius: 15px !important;
    font-weight: bold;
      box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2) !important;
        position: relative;
    border: none !important;
    }

    .btn:active {
        transform: translateY(2px) scale(0.98) !important;
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) !important;
    }

    .btn i {
    font-size: 0.85rem !important;
    }

    /* Smaller hint/reveal buttons */
    .btn-hint,
    .btn-reveal {
    font-size: 0.7rem !important;
    padding: 0.5rem 0.7rem !important;
     min-height: 36px !important;
    }

    .btn-hint i,
    .btn-reveal i {
   font-size: 0.8rem !important;
    }

    /* Button colors */
    .btn-guess {
        background: linear-gradient(180deg, #ff8c00 0%, #ff6b35 100%) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    .btn-confirm {
        background: linear-gradient(180deg, #39ff14 0%, #2dc437 100%) !important;
        color: #000 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    }

 .btn-hint {
        background: linear-gradient(180deg, #9b59b6 0%, #6a0572 100%) !important;
    }

    .btn-reveal {
        background: linear-gradient(180deg, #c41e3a 0%, #8b0000 100%) !important;
    }

    /* Vertical layout for action buttons */
    .riddle-actions,
    .clue-actions {
        display: flex !important;
     flex-direction: column !important;
  gap: 0.4rem !important;
    margin-top: 0.8rem !important;
    }

    .riddle-actions .btn,
    .clue-actions .btn {
        width: 100% !important;
        min-width: auto !important;
    }

    /* Music button - smaller, top right */
    .music-button {
      position: fixed !important;
        top: 70px !important;
    right: 10px !important;
    bottom: auto !important;
      width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
        border-radius: 50% !important;
        border: 2px solid var(--halloween-orange) !important;
        background: rgba(10, 10, 10, 0.9) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 107, 53, 0.3) !important;
        z-index: 1001 !important;
    }

    .music-button:active {
     transform: scale(0.9) !important;
    }

    /* Victory/Game Over - compact */
    .victory-screen,
    .game-over-screen {
        padding: 1rem !important;
    }

    .victory-content,
    .game-over-content {
        padding: 2rem 1.5rem !important;
        border-radius: 25px !important;
        border-width: 4px !important;
    }

    .victory-title,
    .game-over-title {
        font-size: 2.2rem !important;
    }

    .victory-message,
    .game-over-message {
     font-size: 1.3rem !important;
    }

    .game-over-hint {
        font-size: 1.1rem !important;
    }

    .btn-primary {
      font-size: 1rem !important;
        padding: 0.8rem 1.6rem !important;
    }

    /* Stats in victory */
    .final-stats {
        padding: 1.2rem !important;
        border-radius: 15px !important;
        margin: 1.2rem 0 !important;
    }

    .final-stat {
        padding: 0.7rem !important;
        flex-direction: row;
        justify-content: space-between;
    }

    .final-stat-label {
        font-size: 1rem !important;
    }

    .final-stat-value {
        font-size: 1.2rem !important;
    }

    /* Achievement badges */
    .achievement-badge {
        font-size: 1.8rem !important;
        padding: 0.7rem !important;
        width: 55px;
   height: 55px;
    }

    .achievement-card {
        padding: 0.9rem !important;
    border-radius: 15px !important;
        border-width: 2px !important;
 }

    .achievement-icon {
        font-size: 1.8rem !important;
    }

    .achievement-info strong {
        font-size: 1rem !important;
    }

    .achievement-info p {
      font-size: 0.9rem !important;
    }

    .achievements-section h3 {
        font-size: 1.6rem !important;
    }

    /* Simplified decorations */
    .halloween-decorations {
        opacity: 0.15;
    }

    .blood-container,
    .bat,
    .spider {
        display: none;
    }

    .cobweb {
        width: 40px !important;
        height: 40px !important;
        opacity: 0.1 !important;
    }

    .moon {
        width: 35px !important;
  height: 35px !important;
   opacity: 0.25 !important;
        top: 75px !important;
        right: 55px !important;
    }

    .creepy-eyes {
        display: none;
    }

  /* Compact feedback messages */
    .feedback {
        font-size: 0.9rem !important;
        padding: 0.7rem !important;
        border-radius: 15px !important;
        border-width: 2px !important;
        margin-top: 0.7rem !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    }

    /* Compact hint display */
    .hint-display {
    padding: 0.7rem !important;
        border-radius: 15px !important;
   border-width: 2px !important;
        margin-top: 0.7rem !important;
      gap: 0.5rem !important;
    }

    .hint-icon {
        font-size: 1.1rem !important;
      width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
    justify-content: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
    }

    .hint-text {
 font-size: 0.9rem !important;
        line-height: 1.4;
    }

    /* Shop popup - compact */
    .shop-popup {
        padding: 1.5rem !important;
        border-radius: 20px !important;
        max-width: 400px;
    }

    .shop-close {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.1rem !important;
    }

    .shop-title {
        font-size: 1.5rem !important;
      margin-bottom: 1.2rem !important;
    }

    .shop-items {
   gap: 0.8rem !important;
    }

    .shop-item {
        padding: 1.2rem !important;
        border-radius: 15px !important;
    }

    .item-icon {
        font-size: 2.5rem !important;
    }

    .item-info h4 {
      font-size: 1.2rem !important;
    }

    .item-info p {
        font-size: 0.9rem !important;
    }

  .btn-buy {
        font-size: 0.9rem !important;
padding: 0.6rem 1rem !important;
      border-radius: 12px !important;
    }

    /* Bottom menu - fix position */
    .bottom-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
    right: 0 !important;
        z-index: 999 !important;
        background: rgba(10, 10, 10, 0.6) !important;
      backdrop-filter: blur(10px) !important;
        padding: 0.6rem !important;
border-top: 2px solid rgba(255, 107, 53, 0.3) !important;
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.5) !important;
   display: flex !important;
        justify-content: space-evenly !important;
        gap: 0.5rem !important;
    }

    .menu-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    gap: 0.2rem !important;
    padding: 0.5rem 0.8rem !important;
        background: rgba(255, 107, 53, 0.1) !important;
        border: 2px solid var(--halloween-orange) !important;
 border-radius: 12px !important;
        color: var(--halloween-orange) !important;
        font-family: 'Eater', cursive !important;
        font-size: 0.7rem !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        flex: 1 !important;
        max-width: 90px !important;
    }

    .menu-btn i {
   font-size: 1.2rem !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    
    .game-container {
  padding: 65px 0.6rem 60px 0.6rem !important;
    }

    .hud-stats {
        gap: 0.5rem !important;
    }

    .hud-stat {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.85rem !important;
    }

    .hud-stat i {
        font-size: 0.9rem !important;
    }

    .hud-stat span {
     font-size: 1rem !important;
    }

    .mini-radar {
        width: 45px !important;
        height: 45px !important;
    }

    .hud-multiplayer-btn {
  width: 40px !important;
 height: 40px !important;
    }

    .game-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.6rem !important;
    }

    .game-title .pumpkin-icon img,
    .game-title .ghost-icon img {
        width: 30px !important;
   height: 30px !important;
    }

    .riddle-card,
    .clue-card {
        padding: 1rem !important;
    }

    .riddle-text {
        font-size: 1.05rem !important;
        margin-bottom: 0.8rem !important;
   line-height: 1.3 !important;
    }

    .clue-text {
        font-size: 0.95rem !important;
        margin-bottom: 0.8rem !important;
    }

    .clue-title {
        font-size: 1.2rem !important;
    }

    .clue-instruction {
     font-size: 0.85rem !important;
    }

    .answer-input,
    .clue-input {
        padding: 0.7rem !important;
        font-size: 0.9rem !important;
        margin-bottom: 0.6rem !important;
    }

    .btn {
  font-size: 0.75rem !important;
   padding: 0.5rem 0.8rem !important;
      min-height: 36px !important;
    }

    .btn i {
        font-size: 0.8rem !important;
    }

    .btn-hint,
    .btn-reveal {
        font-size: 0.65rem !important;
     padding: 0.45rem 0.6rem !important;
        min-height: 34px !important;
    }

    .btn-hint i,
    .btn-reveal i {
        font-size: 0.75rem !important;
    }

    .riddle-actions,
.clue-actions {
        gap: 0.4rem !important;
    }

    .feedback {
        font-size: 0.85rem !important;
  padding: 0.6rem !important;
    }

    .hint-display {
     padding: 0.7rem !important;
    }

    .hint-icon {
        font-size: 1.1rem !important;
        width: 30px;
        height: 30px;
  }

    .hint-text {
        font-size: 0.85rem !important;
    }

    .btn-primary {
        font-size: 0.95rem !important;
        padding: 0.7rem 1.4rem !important;
    }

    .shop-title {
        font-size: 1.4rem !important;
    }

    .btn-buy {
      font-size: 0.85rem !important;
        padding: 0.5rem 0.9rem !important;
    }
}

/* Landscape mode */
@media (max-width: 768px) and (orientation: landscape) {
    
    .game-container {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .game-main {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* PWA fullscreen */
@media (display-mode: standalone) {
    
    .game-hud {
        padding-top: calc(0.8rem + env(safe-area-inset-top));
    }

    .bottom-menu {
        padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
    }
}

/* Prevent text selection */
@media (hover: none) and (pointer: coarse) {
    
    .game-title,
    .riddle-text,
    .clue-text,
    .btn {
        -webkit-user-select: none;
        user-select: none;
    }

    input,
    textarea {
        -webkit-user-select: text;
user-select: text;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
   animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .halloween-decorations {
        display: none;
    }
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    
    body {
   min-height: -webkit-fill-available;
    }

    input[type="text"],
    textarea {
        font-size: 16px !important;
    }
}

/* Touch feedback */
@media (max-width: 768px) {
    
    .btn:active {
        filter: brightness(0.9);
    }

    .btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s, opacity 0.6s;
        opacity: 0;
        pointer-events: none;
    }

    .btn:active::after {
      width: 150px;
        height: 150px;
      opacity: 0.3;
        transition: width 0s, height 0s, opacity 0.3s;
    }
}
