/* SET Game Styles - Enhanced Visual Design */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 45s ease infinite;
    min-height: 100vh;
    padding: 1.5vh 1.5vw;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Gradient */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Particles Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.08) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
    transition: max-width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Header with Glow Effect */
header {
    text-align: center;
    margin-bottom: 2vh;
    position: relative;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 800;
    color: white;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(255, 255, 255, 0.2),
        3px 3px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5em;
    margin-bottom: 0.5vh;
    animation: titleGlow 3s ease-in-out infinite alternate;
    position: relative;
    display: inline-block;
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.5),
            0 0 20px rgba(255, 255, 255, 0.3),
            0 0 40px rgba(255, 255, 255, 0.2),
            3px 3px 6px rgba(0, 0, 0, 0.3);
        filter: brightness(1);
    }
    100% {
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 40px rgba(255, 255, 255, 0.5),
            0 0 60px rgba(255, 255, 255, 0.3),
            3px 3px 6px rgba(0, 0, 0, 0.3);
        filter: brightness(1.1);
    }
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mode Selector with Glassmorphism */
.mode-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1vw;
    margin-bottom: 2vh;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.mode-buttons-left {
    display: flex;
    gap: 1vw;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 1.2vh 2.5vw;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.mode-btn:hover::before {
    left: 100%;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.mode-btn.active {
    background: white;
    color: #e73c7e;
    border-color: white;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Help Button */
.help-btn {
    padding: 1.2vh 2.5vw;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.help-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Game Info Panel */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2vh;
    padding: 1.5vh 2vw;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    animation: fadeInUp 0.8s ease-out 0.3s both;
    position: relative;
    overflow: hidden;
}

.progress {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    font-weight: 600;
    color: #333;
}

#sets-found {
    color: #e73c7e;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(231, 60, 126, 0.2);
}

.new-game-btn {
    padding: 1.2vh 2vw;
    border: 2px solid rgba(231, 60, 126, 0.5);
    border-radius: 50px;
    background: rgba(231, 60, 126, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e73c7e;
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.new-game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(231, 60, 126, 0.2), transparent);
    transition: left 0.5s ease;
}

.new-game-btn:hover::before {
    left: 100%;
}

.new-game-btn:hover {
    background: rgba(231, 60, 126, 0.25);
    border-color: rgba(231, 60, 126, 0.7);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(231, 60, 126, 0.2);
}

/* Game Board Area */
.game-area {
    display: flex;
    gap: clamp(12px, 2vw, 24px);
    flex: 1;
    min-height: 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Game Board with Glassmorphism */
.game-board {
    display: grid;
    gap: clamp(8px, 1.2vw, 15px);
    padding: clamp(12px, 2vw, 20px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    flex: 1;
    min-height: 0;
    position: relative;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-board::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent, rgba(255, 255, 255, 0.4));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.5;
}

.game-board.basic {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.game-board.advanced {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

/* Wider container for advanced mode */
body.advanced-mode .container {
    max-width: 1200px;
}

/* Found SETs Panel */
.found-sets-panel {
    width: clamp(180px, 26vw, 280px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: clamp(12px, 1.8vw, 18px);
    display: flex;
    flex-direction: column;
    position: relative;
}

.found-sets-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent, rgba(255, 255, 255, 0.4));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.5;
}

.found-sets-panel h3 {
    text-align: center;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: #333;
    margin-bottom: clamp(10px, 1.2vh, 18px);
    padding-bottom: 10px;
}

.found-sets-list {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.2vh, 12px);
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.found-sets-list::-webkit-scrollbar {
    width: 6px;
}

.found-sets-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.found-sets-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #e73c7e, #23a6d5);
    border-radius: 3px;
}

.found-set-item {
    display: flex;
    justify-content: center;
    gap: 3px;
    padding: clamp(6px, 0.8vw, 10px);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 2px solid rgba(231, 60, 126, 0.3);
    position: relative;
    animation: foundSetAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes foundSetAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.found-set-item .mini-card {
    width: clamp(50px, 7vw, 75px);
    height: clamp(28px, 4.5vw, 42px);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.found-set-item .mini-card .shape {
    width: clamp(12px, 1.8vw, 20px);
    height: clamp(20px, 3vw, 32px);
}

/* Hint Button */
.hint-btn {
    width: 100%;
    padding: clamp(10px, 1.8vh, 14px) clamp(8px, 1.2vw, 12px);
    margin-top: clamp(10px, 1.2vh, 15px);
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 50px;
    background: rgba(255, 193, 7, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e6a800;
    font-size: clamp(0.85rem, 1.4vw, 0.95rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.hint-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.2), transparent);
    transition: left 0.5s ease;
}

.hint-btn:hover::before {
    left: 100%;
}

.hint-btn:hover {
    background: rgba(255, 193, 7, 0.25);
    border-color: rgba(255, 193, 7, 0.7);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.2);
}

.hint-btn:active {
    transform: translateY(0) scale(0.98);
}

.card.hint {
    animation: hintGlow 1.5s ease-in-out 3;
}

@keyframes hintGlow {
    0% { 
        box-shadow: 0 0 10px 5px rgba(255, 193, 7, 0.3), 0 0 30px 10px rgba(255, 193, 7, 0.2), 0 0 50px 20px rgba(255, 193, 7, 0.1);
    }
    50% { 
        box-shadow: 0 0 20px 10px rgba(255, 193, 7, 0.6), 0 0 50px 25px rgba(255, 193, 7, 0.4), 0 0 80px 40px rgba(255, 193, 7, 0.2);
    }
    100% { 
        box-shadow: 0 0 10px 5px rgba(255, 193, 7, 0.3), 0 0 30px 10px rgba(255, 193, 7, 0.2), 0 0 50px 20px rgba(255, 193, 7, 0.1);
    }
}

.card {
    border-radius: clamp(10px, 1.5vw, 16px);
    cursor: pointer;
    perspective: 1000px;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 90px;
}

/* Card inner container for 3D flip */
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Flip the card when flipped class is added */
.card.flipped .card-inner {
    transform: rotateY(180deg);
}

/* Card faces - front (haz) and back (reves) */
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: clamp(10px, 1.5vw, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(6px, 1vw, 10px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Card front (haz) - shows the figure */
.card-front {
    background: white;
    border: 4px solid rgba(0, 0, 0, 0.12);
    transform: rotateY(180deg);
}

/* Card back (reves) - vibrant gradient background */
.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border: 4px solid rgba(0, 0, 0, 0.2);
}

/* Hide back when card is completely flipped (after 0.2s animation) */
.card.flipped .card-back {
    animation: hideBack 0s 0.2s forwards;
}

@keyframes hideBack {
    to {
        visibility: hidden;
    }
}

/* Decorative pattern on card back */
.card-back::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: clamp(6px, 1vw, 12px);
    pointer-events: none;
}

.card-back::after {
    content: 'SET';
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.3em;
}

/* Card hover effects */
.card:hover .card-back {
    border-color: #e73c7e;
    box-shadow: 
        0 15px 35px rgba(231, 60, 126, 0.25),
        0 0 0 4px rgba(231, 60, 126, 0.15);
}

.card:hover .card-front {
    border-color: #e73c7e;
    box-shadow: 
        0 15px 35px rgba(231, 60, 126, 0.25),
        0 0 0 4px rgba(231, 60, 126, 0.15);
}

.card.selected {
    transform: translateY(-5px);
}

.card.selected .card-front {
    border-color: #e73c7e;
    background: linear-gradient(135deg, rgba(231, 60, 126, 0.1), rgba(35, 166, 213, 0.1));
    box-shadow: 
        0 0 0 4px rgba(231, 60, 126, 0.3),
        0 10px 30px rgba(231, 60, 126, 0.2);
}

.card.correct .card-front {
    border-color: #4caf50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    box-shadow: 
        0 0 0 4px rgba(76, 175, 80, 0.3),
        0 10px 30px rgba(76, 175, 80, 0.3);
}

.card.incorrect .card-front {
    border-color: #f44336;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.15), rgba(244, 67, 54, 0.05));
    box-shadow: 
        0 0 0 4px rgba(244, 67, 54, 0.3),
        0 10px 30px rgba(244, 67, 54, 0.2);
}

.card.duplicate .card-front {
    border-color: #ff9800;
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 152, 0, 0.05));
    box-shadow: 
        0 0 0 4px rgba(255, 152, 0, 0.3),
        0 10px 30px rgba(255, 152, 0, 0.2);
}

/* Card Content (Shapes) */
.card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 0.6vw, 6px);
    width: 100%;
    height: 100%;
}

.shape {
    width: clamp(26px, 4.5vw, 40px);
    height: clamp(46px, 8vw, 72px);
    flex-shrink: 0;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.card:hover .shape {
    transform: scale(1.05);
}

/* Colors - More Vibrant */
.shape.red { 
    fill: #ff4757; 
    stroke: #ff4757; 
    filter: drop-shadow(0 2px 4px rgba(255, 71, 87, 0.4));
}
.shape.green { 
    fill: #2ed573; 
    stroke: #2ed573; 
    filter: drop-shadow(0 2px 4px rgba(46, 213, 115, 0.4));
}
.shape.purple { 
    fill: #a55eea; 
    stroke: #a55eea; 
    filter: drop-shadow(0 2px 4px rgba(165, 94, 234, 0.4));
}

/* Shading */
.shape.solid {
    fill-opacity: 1;
}

.shape.striped {
    fill-opacity: 0.35;
    stroke-width: 4;
}

.shape.empty {
    fill-opacity: 0;
    stroke-width: 4;
}

/* Win Overlay - Enhanced */
.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.win-overlay.hidden {
    display: none;
}

.win-message {
    background: white;
    padding: clamp(30px, 5vw, 50px) clamp(40px, 7vw, 70px);
    border-radius: 30px;
    text-align: center;
    animation: winPopIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.win-message::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(231, 60, 126, 0.1),
        transparent,
        rgba(35, 166, 213, 0.1),
        transparent
    );
    animation: rotateBg 10s linear infinite;
    z-index: -1;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes winPopIn {
    0% { 
        transform: scale(0.3) rotate(-10deg); 
        opacity: 0; 
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1; 
    }
}

.win-message h2 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 1.5vh;
}

.win-message h2 .emoji {
    font-style: normal;
}

.win-message h2 .gradient-text {
    background: linear-gradient(135deg, #e73c7e, #23a6d5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.win-message p {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #666;
    margin-bottom: 2vh;
    font-weight: 500;
}

/* Help Overlay - Enhanced */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.help-overlay.hidden {
    display: none;
}

.help-message {
    background: white;
    padding: clamp(25px, 4vw, 45px);
    border-radius: 25px;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    animation: helpSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 20px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5);
}

@keyframes helpSlideIn {
    0% { 
        transform: translateY(-50px) scale(0.9); 
        opacity: 0; 
    }
    100% { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.help-message h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
}

.help-message h2 .emoji {
    font-style: normal;
}

.help-message h2 .gradient-text {
    background: linear-gradient(135deg, #e73c7e, #23a6d5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.help-content {
    color: #444;
    line-height: 1.7;
}

.help-content h3 {
    color: #e73c7e;
    margin-top: 18px;
    margin-bottom: 10px;
    font-size: 1.15rem;
    font-weight: 600;
}

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

.help-content ul,
.help-content ol {
    margin-left: 22px;
    margin-bottom: 12px;
}

.help-content li {
    margin-bottom: 6px;
}

.help-content strong {
    color: #333;
    font-weight: 600;
}

.help-message button {
    display: block;
    margin: 25px auto 0;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f00;
    pointer-events: none;
    z-index: 1000;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 1.5vh 2.5vw;
    }
    
    h1 {
        letter-spacing: 0.3em;
    }

    .mode-selector {
        flex-direction: column;
        gap: 1vh;
    }

    .mode-buttons-left {
        flex-direction: column;
        width: 100%;
    }

    .mode-btn, .help-btn {
        width: 100%;
        padding: 1.4vh 2vw;
    }

    .game-info {
        flex-direction: column;
        gap: 1.2vh;
        text-align: center;
    }

    .game-board.advanced {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    .game-area {
        flex-direction: column;
    }

    .found-sets-panel {
        width: 100%;
        max-height: 180px;
    }

    .found-sets-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .found-set-item {
        flex: 0 0 auto;
    }
}

/* Card Entrance Animation - Cards appear face-down */
.card.entering {
    opacity: 0;
    animation: cardEntrance 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered Card Animation */
.game-board .card.entering:nth-child(1) { animation-delay: 0.05s; }
.game-board .card.entering:nth-child(2) { animation-delay: 0.1s; }
.game-board .card.entering:nth-child(3) { animation-delay: 0.15s; }
.game-board .card.entering:nth-child(4) { animation-delay: 0.2s; }
.game-board .card.entering:nth-child(5) { animation-delay: 0.25s; }
.game-board .card.entering:nth-child(6) { animation-delay: 0.3s; }
.game-board .card.entering:nth-child(7) { animation-delay: 0.35s; }
.game-board .card.entering:nth-child(8) { animation-delay: 0.4s; }
.game-board .card.entering:nth-child(9) { animation-delay: 0.45s; }
.game-board .card.entering:nth-child(10) { animation-delay: 0.5s; }
.game-board .card.entering:nth-child(11) { animation-delay: 0.55s; }
.game-board .card.entering:nth-child(12) { animation-delay: 0.6s; }

/* Pulse Animation for Progress */
@keyframes progressPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#sets-found.pulse {
    animation: progressPulse 0.4s ease;
}

/* Decorative Background Elements */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(40px);
}

.floating-shape.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    top: -150px;
    left: -100px;
    animation: floatShape1 20s ease-in-out infinite;
}

.floating-shape.shape-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #5f27cd, #48dbfb);
    bottom: -100px;
    right: -100px;
    animation: floatShape2 25s ease-in-out infinite;
}

.floating-shape.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #1dd1a1, #10ac84);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatShape3 18s ease-in-out infinite;
}

@keyframes floatShape1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, 50px) rotate(90deg); }
    50% { transform: translate(100px, 0) rotate(180deg); }
    75% { transform: translate(50px, -50px) rotate(270deg); }
}

@keyframes floatShape2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-80px, -60px) rotate(120deg); }
    66% { transform: translate(-40px, 40px) rotate(240deg); }
}

@keyframes floatShape3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* Confetti Container */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.mode-btn:active, .help-btn:active, .new-game-btn:active, .hint-btn:active {
    transform: translateY(0) scale(0.97);
}

.found-sets-list {
    scrollbar-width: thin;
    scrollbar-color: linear-gradient(180deg, #e73c7e, #23a6d5) rgba(0, 0, 0, 0.05);
}

.card:hover .card-front,
.card:hover .card-back {
    box-shadow: 
        0 15px 35px rgba(231, 60, 126, 0.25),
        0 0 0 4px rgba(231, 60, 126, 0.15),
        0 0 30px rgba(231, 60, 126, 0.1);
}
