/* Main CSS for Treasuretrap */

/* This file imports all main CSS components */

/* Import CSS variables */
@import 'main-variables.css';

/* Import base styles */
@import 'main-base.css';

/* Import layout styles */
@import 'main-layout.css';

/* Import modal styles */
@import 'main-modals.css';

/* Import button styles */
@import 'main-buttons.css';

/* Import utility styles */
@import 'main-utilities.css';

/* Force all text to use Pirata One font */
* {
    font-family: var(--title-font) !important;
}

/* FIXED: Improved readability for numeric values */
#current-loot, #total-score, #trap-count, #final-score, #high-score-value, 
#stat-cards-drawn, #stat-level, #level-indicator, #trap-probability, #cards-drawn,
.score-value, .card-value, .stat-value, .score-entry span, #high-score,
span[id$="-value"], span[id$="-count"], span[id$="-probability"], span[id$="-score"], span[id$="-drawn"],
[data-numeric="true"] {
    font-family: var(--numeric-font) !important;
}

/* Active Effects Styles */
.active-effects-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

/* Tooltip instructions */
.active-effects-container::before {
    content: "Double-tap effects for details";
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--gold-color);
    opacity: 0.8;
    pointer-events: none;
    white-space: nowrap;
}

.active-effects {
    display: flex;
    gap: 10px;
}

/* Active effect icons styling */
.effect-icon {
    display: inline-flex;
    position: relative;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 0.3rem;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 1.3rem;
    cursor: pointer;
}

.effect-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

/* Effect tooltips - disabled in favor of double-tap to show info */
.effect-icon::after {
    content: attr(data-effect-name);
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: var(--gold-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: normal;
    max-width: 80%;
    width: auto;
    text-align: center;
    opacity: 0; /* Always hidden - using double-tap for info */
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gold-color);
    display: none; /* Hide completely */
}

/* Hide tooltips on hover since we're using double-tap */
.effect-icon:hover::after {
    opacity: 0;
    display: none;
}

/* Add positioning classes for edge detection */
.effect-icon.tooltip-left::after {
    left: 50%; /* Keep centered */
    transform: translateX(-50%);
    /* Edge detection handled by JavaScript */
}

.effect-icon.tooltip-right::after {
    left: 50%; /* Keep centered */
    transform: translateX(-50%);
    /* Edge detection handled by JavaScript */
}

/* Add JavaScript to position tooltips */
/* This code will be moved to a script file later */
/* Instead, we'll add styles that handle most cases */

/* Mobile device optimization for tooltips */
@media (max-width: 480px) {
    .effect-icon::after {
        max-width: 90%; /* Wider on mobile */
        font-size: 0.8rem; /* Slightly smaller text */
        top: 40px; /* Closer to top on mobile */
        padding: 6px 12px; /* Larger touch target */
    }
}

.effect-icon:hover::after {
    opacity: 1;
}

/* Effect count badge */
.effect-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff5722;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    border: 2px solid white;
    z-index: 10;
}

/* Pulsing animation for stacked effects */
.effect-stacked {
    animation: effect-pulse 2s infinite ease-in-out;
}

@keyframes effect-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* Effect duration indicator */
.effect-duration {
    position: absolute;
    bottom: -8px;
    right: -8px;
    background-color: #3498db;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
    border: 2px solid white;
    z-index: 5;
}

/* Special styling for decay effect duration indicators */
.decay-effect .effect-duration {
    background-color: #cc0000;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.6);
    animation: pulse-duration 2s infinite;
}

@keyframes pulse-duration {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Special effect styles */
.decay-effect {
    animation: decay-pulse 2s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Decay pulse animation */
@keyframes decay-pulse {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { transform: scale(1.08); box-shadow: 0 0 15px rgba(255, 0, 0, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
}

/* Styling for high potency decay */
.decay-potent {
    animation: decay-potent-pulse 2s infinite ease-in-out !important;
    box-shadow: 0 0 15px rgba(204, 0, 0, 0.8) !important;
    border: 2px solid darkred !important;
}

/* Potency badge for decay */
.potency-badge {
    background-color: #cc0000 !important;
    border: 2px solid #ff3333 !important;
    animation: badge-pulse 2s infinite alternate !important;
}

@keyframes badge-pulse {
    0% { box-shadow: 0 0 5px rgba(255, 0, 0, 0.5); }
    100% { box-shadow: 0 0 10px rgba(255, 0, 0, 0.9); }
}

@keyframes decay-potent-pulse {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(204, 0, 0, 0.6); }
    50% { transform: scale(1.12); box-shadow: 0 0 20px rgba(255, 0, 0, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(204, 0, 0, 0.6); }
}

.shield-shake {
    animation: shield-shake 1s;
}

@keyframes shield-shake {
    0%, 100% { transform: rotate(0); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-5deg); }
    20%, 40%, 60%, 80% { transform: rotate(5deg); }
}

/* Card Gallery Styles - New Design */
.card-gallery-content {
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #1e2b38 0%, #283845 100%);
    border: 2px solid var(--gold-color);
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.3);
    padding: 0 !important;
    border-radius: 12px;
}

.card-gallery-content h2 {
    font-size: 2.5rem;
    text-align: center;
    color: var(--gold-color);
    margin: 20px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    position: relative;
    display: inline-block;
    width: 100%;
}

.card-gallery-content h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-color), transparent);
}

.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(30, 43, 56, 1) 0%, rgba(30, 43, 56, 0.95) 100%);
    padding: 15px 0;
    z-index: 5;
    width: 100%;
    flex-wrap: wrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.gallery-tab {
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--light-color);
    border: 1px solid var(--gold-color);
    border-radius: 30px;
    padding: 10px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.gallery-tab.active {
    background: linear-gradient(135deg, var(--gold-color) 0%, #daa520 100%);
    color: #111;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.5);
    transform: translateY(-2px);
}

.gallery-tab:hover:not(.active) {
    background-color: rgba(218, 165, 32, 0.15);
    transform: translateY(-2px);
}

.gallery-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.gallery-tab:hover::before {
    transform: translateX(100%);
}

.gallery-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 25px;
    padding: 20px 30px 40px;
    overflow-y: auto;
    align-items: start;
    max-height: none;
}

/* Gallery card container styles */
.gallery-card-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(218, 165, 32, 0.2);
}

.gallery-card-container:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.4);
    border-color: var(--gold-color);
}

.gallery-card-container .card {
    transform: scale(0.9);
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}

.gallery-card-container:hover .card {
    transform: scale(0.95) rotate(2deg);
}

.gallery-card-info {
    background: linear-gradient(145deg, rgba(30, 43, 56, 0.8), rgba(20, 30, 40, 0.9));
    border: 1px solid var(--gold-color);
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.gallery-card-container:hover .gallery-card-info {
    box-shadow: 0 6px 12px rgba(0,0,0,0.4), 0 0 10px rgba(218, 165, 32, 0.2);
}

.gallery-card-info .gallery-card-name {
    font-weight: bold;
    color: var(--gold-color);
    margin-bottom: 8px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.gallery-card-description {
    font-size: 0.9rem;
    opacity: 0.9;
    color: #f0f0f0;
}

.modal-buttons {
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

.modal-buttons button {
    background: linear-gradient(135deg, var(--gold-color) 0%, #daa520 100%);
    color: #111;
    border: none;
    padding: 12px 30px;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.modal-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3), 0 0 15px rgba(218, 165, 32, 0.4);
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
        padding: 15px 20px 30px;
    }
    
    .gallery-tab {
        padding: 8px 20px;
        min-width: 100px;
        font-size: 1rem;
    }
    
    .card-gallery-content h2 {
        font-size: 2rem;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 10px 15px 25px;
    }
    
    .gallery-card-container {
        padding: 10px;
    }
    
    .gallery-tab {
        padding: 6px 15px;
        min-width: 90px;
        font-size: 0.9rem;
    }
    
    .card-gallery-content h2 {
        font-size: 1.8rem;
    }
    
    .gallery-card-info {
        padding: 8px;
    }
    
    .gallery-card-info .gallery-card-name {
        font-size: 1.1rem;
    }
}

/* Streak Indicator Styles */
.streak-container, .highest-streak-container {
    position: relative;
    margin-right: 10px;
}

#streak-value, #highest-streak-value {
    transition: all 0.3s ease;
    margin-left: 5px;
}

/* Special highlight for highest streak */
#highest-streak-value {
    font-weight: bold;
}

/* Add a trophy icon effect for highest streak container */
.highest-streak-container .status-label::before {
    content: "🏆 ";
    font-size: 0.9em;
    margin-right: 2px;
}

.streak-multiplier {
    color: var(--primary-color);
    font-weight: bold;
    margin-left: 2px;
}

/* Streak level styles */
.streak-low {
    color: #99ccff;
}

.streak-medium {
    color: #66ccff;
    font-weight: bold;
}

.streak-high {
    color: #ffcc00;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

.streak-max {
    color: #ff9900;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(255, 153, 0, 0.7);
    animation: pulse-streak 1s infinite alternate;
}

@keyframes pulse-streak {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Next Cards Preview Styles */
.next-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.next-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
}

.next-card-container .card {
    transform: scale(0.8);
    margin-bottom: 5px;
}

.card-number {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.card-info {
    font-size: 0.9rem;
    text-align: center;
    margin-top: 5px;
}

/* Inventory styles */
.inventory-slot {
    position: relative;
    border: 1px solid var(--gold-color);
    border-radius: var(--border-radius);
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    text-align: center;
    min-height: 140px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin: 0 5px;
}

.inventory-slot .card {
    margin-bottom: 10px;
    transform: scale(0.8);
    position: relative;
    z-index: 1;
}

.inventory-buttons {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 5px;
}

.discard-card-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background-color: #f44336;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.discard-card-icon:hover {
    background-color: #d32f2f;
    transform: scale(1.2);
}

.discard-card-icon:active {
    transform: scale(0.9);
}

.empty-slot-indicator {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    margin-top: 25px;
    font-size: 1.2rem;
}

/* Start Screen Animation Effects */
.game-container {
    position: relative;
    overflow: hidden;
}

/* Floating treasure background elements - REMOVED */
/*
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-element {
    position: absolute;
    opacity: 0.2;
    animation: float-animation 15s infinite linear;
    z-index: 1;
}

.floating-coin {
    font-size: 2rem;
    color: var(--gold-color);
}

.floating-gem {
    font-size: 2.5rem;
    color: #5d9cec;
}

.floating-chest {
    font-size: 3rem;
    color: #a06a1b;
}

.floating-map {
    font-size: 2.8rem;
    color: #8d6e63;
}
*/

/* Gold particle effects - REMOVED */
/*
.gold-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, #ffdf87 0%, #f1c40f 100%);
    border-radius: 50%;
    width: 4px;
    height: 4px;
    opacity: 0.7;
    z-index: 1;
    animation: particle-animation 15s infinite linear;
}

@keyframes particle-animation {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-30px) translateX(10px);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-50px) translateX(20px);
        opacity: 0.5;
    }
    75% {
        transform: translateY(-30px) translateX(10px);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }
}
*/

/* Enhanced Mode Card Styling */
.mode-card {
    transition: all 0.3s ease;
    transform-style: preserve-3d;
    position: relative;
    background: linear-gradient(145deg, #283845, #1e2a36);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--gold-color);
    padding: 25px;
}

.mode-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6), 
                0 0 15px rgba(255, 215, 0, 0.4);
}

.mode-card h2 {
    position: relative;
    display: inline-block;
    font-size: 2rem;
    margin-bottom: 15px;
}

.mode-card h2:after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--gold-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.mode-card:hover h2:after {
    transform: scaleX(1);
    transform-origin: left;
}

.mode-card p {
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Recent Scores Display */
.recent-scores-display {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 25px;
    width: 320px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.recent-scores-display h3 {
    text-align: center;
    color: var(--gold-color);
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.score-entry:last-child {
    border-bottom: none;
}

.score-date {
    opacity: 0.8;
    font-size: 1.1rem;
}

.score-value {
    font-weight: bold;
    color: var(--gold-color);
    font-size: 1.3rem;
}

/* Game Title Enhancement */
.game-title {
    position: relative;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: title-glow 3s infinite alternate;
}

@keyframes title-glow {
    0% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 
                    0 0 30px rgba(255, 215, 0, 0.4);
    }
}

/* Quick Links */
.quick-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.quick-link {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--gold-color);
    color: var(--light-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 150px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quick-link:hover {
    background-color: rgba(240, 195, 60, 0.85);
    color: #2c3e50; /* Darker blue color for better contrast */
    border: 1px solid #fff;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    font-weight: bold;
}

/* Game Intro and Tips */
.game-intro {
    text-align: center;
    color: var(--light-color);
    max-width: 500px;
    margin: 0 auto 25px auto;
    font-size: 1.1rem;
    line-height: 1.4;
    opacity: 0.9;
}

.daily-tip {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    margin: 25px auto 0 auto;
    max-width: 500px;
    border-left: 3px solid #64b5f6;
    opacity: 0;
    animation: fade-in 1s forwards 0.5s;
}

.tip-icon {
    color: #64b5f6;
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness for Start Screen */
@media (max-width: 768px) {
    /* Game intro text */
    .game-intro {
        font-size: 1rem;
        padding: 0 15px;
        margin-bottom: 20px;
    }
    
    /* Mode card adjustments */
    .mode-card {
        max-width: 90%;
        padding: 15px;
    }
    
    /* Fewer particles and floating elements for better performance */
    .particle:nth-child(n+15) {
        display: none;
    }
    
    .floating-element:nth-child(n+7) {
        display: none;
    }
    
    /* Smaller floating elements */
    .floating-coin {
        font-size: 1.5rem;
    }
    
    .floating-gem {
        font-size: 2rem;
    }
    
    .floating-chest {
        font-size: 2.5rem;
    }
    
    /* Recent scores display */
    .recent-scores-display {
        width: 85%;
        max-width: 280px;
        margin-top: 15px;
    }
    
    /* Quick links stack on smaller screens */
    .quick-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .quick-link {
        width: 200px;
        text-align: center;
        padding: 10px 0;
        min-height: 44px; /* Minimum touch target size */
    }
    
    /* Daily tip adjustments */
    .daily-tip {
        width: 85%;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    /* Game title */
    .game-title {
        font-size: 2.5rem;
    }
    
    /* Simpler animations for better performance */
    /* (Removed references to floating elements and particles) */
} 

/* Second Wind Animation for Trap Counter */
@keyframes second-wind-glow {
    0% {
        box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(241, 196, 15, 1), 0 0 30px rgba(241, 196, 15, 0.7);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
        transform: scale(1);
    }
}

.second-wind-active {
    animation: second-wind-glow 2s ease-in-out 3;
    color: #f39c12 !important;
    text-shadow: 0 0 5px rgba(243, 156, 18, 0.7);
}

/* Modal base styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 80%;
    max-height: 85vh; /* ADDED: Prevent overflow on small screens */
    overflow-y: auto; /* ADDED: Enable scrolling for tall content */
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

/* ADDED: Better touch support for modals on mobile */
@media (max-width: 767px) {
    .modal-content {
        max-width: 95%;
        padding: var(--spacing-lg);
    }
    
    .button-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    /* Fixed safe area for notched phones */
    .modal {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

/* ADDED: Fix for button layout on small screens */
@media (max-width: 480px) {
    .button-container {
        width: 100%;
    }
    
    .button-container button {
        width: 100%;
        margin: 5px 0;
    }
    
    .modal-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-buttons button {
        width: 100%;
    }
}

/* Card appearance improvements */
.card {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.card-title {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

.card-value {
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
    font-weight: bold;
}

.card-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Score panel improvements */
.score-panel {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.score-box {
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius);
    padding: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Button improvements */
.action-buttons button {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.action-buttons button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    .score-box p:last-child {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    
    .inventory-container {
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: var(--border-radius);
        padding: 15px 10px;
        margin-top: 15px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .inventory-slots {
        gap: 10px;
    }
    
    .inventory-slot {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    }
    
    .empty-slot-indicator {
        color: rgba(255, 255, 255, 0.6);
    }
    
    /* Larger touch targets for buttons */
    .action-buttons button {
        min-height: 48px;
    }
    
    /* Make the special card type and badge more readable */
    .special-badge, .trap-type {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
        font-weight: bold;
    }
}

/* Extra status bar improvements for small screens */
@media (max-width: 480px) {
    .status-bar {
        background-color: rgba(44, 62, 80, 0.85); /* Made slightly more opaque for better contrast */
        border-bottom: 2px solid var(--gold-color);
    }
    
    .status-item {
        position: relative;
    }
    
    .status-label {
        opacity: 0.9; /* Increased for better visibility */
        text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8); /* Added text shadow for better readability */
    }
    
    /* Enhance value indicators */
    #level-indicator, #trap-probability, #cards-drawn, #streak-value {
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    }
}

/* Enhance text shadows for mobile to improve readability */
@media (max-width: 480px) {
    .card-title, .score-box p:last-child, .inventory-container h3 {
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* X Marks the Spot - Card Selection Improvements */
/* (All mini-game CSS has been removed) */ 

/* Fog effect on trap probability */
.fogged {
    position: relative;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    color: transparent;
    animation: fog-flicker 3s infinite alternate;
}

.fogged::before {
    content: '??%';
    position: absolute;
    top: 0;
    left: 0;
    color: var(--light-color);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    opacity: 0.8;
}

@keyframes fog-flicker {
    0% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
    100% {
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    }
}

/* Mobile card label for inventory items */
.card-mobile-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: var(--gold-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none;
    z-index: 100;
    text-align: center;
    border: 1px solid var(--gold-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-mobile-label.visible {
    opacity: 1;
    visibility: visible;
    animation: label-pop 0.3s ease-out;
}

@keyframes label-pop {
    0% { transform: translateX(-50%) scale(0.7); opacity: 0; }
    70% { transform: translateX(-50%) scale(1.1); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Mobile adjustments for the card label */
@media (max-width: 767px) {
    .card-mobile-label {
        bottom: -25px;
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .card-mobile-label {
        bottom: -22px;
        font-size: 0.75rem;
        padding: 3px 6px;
    }
}

/* Effect interaction animations */
@keyframes shake {
    0% { transform: translate(0, 0) rotate(0); }
    20% { transform: translate(-3px, 0) rotate(-5deg); }
    40% { transform: translate(3px, 0) rotate(5deg); }
    60% { transform: translate(-3px, 0) rotate(-5deg); }
    80% { transform: translate(3px, 0) rotate(5deg); }
    100% { transform: translate(0, 0) rotate(0); }
}

@keyframes glow {
    0% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
    50% { filter: brightness(1.5) drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)); }
    100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 255, 255, 0)); }
}

@keyframes fadeOut {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

@keyframes unlock {
    0% { transform: rotate(0); }
    20% { transform: rotate(90deg); }
    40% { transform: rotate(60deg); }
    60% { transform: rotate(90deg); }
    80% { transform: rotate(80deg); }
    100% { transform: rotate(90deg); }
}

/* Effect interaction classes */
.effect-neutralize {
    animation: shake 0.6s ease-in-out, fadeOut 0.75s ease-in-out forwards;
}

.effect-purify {
    animation: glow 0.6s ease-in-out, fadeOut 0.75s ease-in-out forwards;
}

.effect-unlock {
    animation: unlock 0.5s ease-in-out, fadeOut 0.75s ease-in-out forwards;
}

/* Particles */
.antidote-particle {
    box-shadow: 0 0 4px #39e600; 
}

.crystal-particle {
    box-shadow: 0 0 4px #00bfff;
}

/* Tutorial specific styles */
.tutorial-content {
    max-width: 600px;
    text-align: center;
}

#tutorial-title {
    color: var(--gold-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

#tutorial-content {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Button styling for the effects tutorial button */
#effects-tutorial-button {
    position: relative;
}

#effects-tutorial-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, rgba(255,215,0,0) 70%);
    animation: pulse-effect 2s infinite;
    pointer-events: none;
}

@keyframes pulse-effect {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* Status bar layout improvements */
.status-bar {
    display: flex;
    flex-direction: column;
    padding: 8px 15px;
    gap: 8px;
}

.status-row {
    display: flex;
    width: 100%;
}

.stats-row {
    justify-content: space-between;
    border-bottom: 1px solid rgba(218, 165, 32, 0.3);
    padding-bottom: 8px;
}

.effects-row {
    justify-content: center;
    min-height: 50px;
}

.active-effects-container {
    display: flex;
    width: 100%;
    justify-content: center;
    position: relative;
}

/* Tooltip instructions */
.active-effects-container::before {
    content: "Double-tap effects for details";
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--gold-color);
    opacity: 0.8;
    pointer-events: none;
    white-space: nowrap;
}

/* Market Ban special styling */
.effect-icon[data-effect="market-ban"] {
    border-color: #ff5722;
    box-shadow: 0 0 8px rgba(255, 87, 34, 0.7);
}

.effect-icon[data-effect="market-ban"] .effect-duration {
    background-color: #e74c3c;
    font-weight: 800;
    border: 2px solid white;
}

/* Compass with potency styling */
.compass-potent {
    animation: compass-potent-pulse 2s infinite ease-in-out;
    box-shadow: 0 0 15px rgba(65, 105, 225, 0.8);
    border: 2px solid royalblue;
}

.compass-potency {
    background-color: #4169e1 !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px rgba(65, 105, 225, 0.8) !important;
    border: 2px solid white !important;
    font-size: 0.85rem !important;
}

@keyframes compass-potent-pulse {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(65, 105, 225, 0.8); }
    50% { transform: scale(1.12); box-shadow: 0 0 20px rgba(65, 105, 225, 1); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(65, 105, 225, 0.8); }
}

/* Add styles for inventory replacement modal */
.inventory-choice-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.inventory-choice-cards {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.inventory-choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    min-width: 150px;
}

.inventory-choice-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--gold-color);
}

.inventory-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.replacement-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
    width: 100%;
}

.replacement-options button {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.replacement-options button:hover {
    background-color: rgba(0, 0, 0, 0.5);
    border-color: var(--gold-color);
}

.replacement-options button .card-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .inventory-choice-container {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .inventory-choice-cards {
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    .inventory-options {
        flex: 1;
    }
} 