/* Pastel Color Palette */
:root {
    --pastel-pink: #FFB3D9;
    --pastel-purple: #E6B3FF;
    --pastel-blue: #B3D9FF;
    --pastel-green: #B3FFD9;
    --pastel-yellow: #FFFFB3;
    --pastel-orange: #FFD9B3;
    --pastel-mint: #B3FFE6;
    --bg-primary: #FFF5F5;
    --bg-secondary: #FFE0EC;
    --text-primary: #5D4E60;
    --text-secondary: #8B7D8B;
    --border-color: #E6D5E8;
    --shadow: rgba(199, 149, 193, 0.2);
}

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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple), var(--pastel-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Progress Tracker */
.progress-tracker {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.game-status {
    background: white;
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-status:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

.game-icon {
    font-size: 1.5rem;
}

.game-name {
    font-weight: bold;
    color: var(--text-primary);
}

.status-indicator {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.status-indicator.completed {
    transform: rotate(360deg);
}

/* Intro Screen */
.intro-screen {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-content {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 8px 25px var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}

.intro-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple), var(--pastel-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-content p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.start-btn {
    font-size: 1.2rem;
    padding: 15px 40px;
    border-radius: 30px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple));
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(199, 149, 193, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(199, 149, 193, 0.4);
    background: linear-gradient(45deg, var(--pastel-purple), var(--pastel-blue));
}

.start-btn:active {
    transform: translateY(0);
}

/* Game Containers */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px var(--shadow);
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out;
}

/* Game Headers */
.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--pastel-purple);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

.game-controls {
    text-align: center;
    margin-top: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn.primary {
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple));
    color: white;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(199, 149, 193, 0.4);
}

/* Memory Game Styles */
.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(45deg, var(--pastel-blue), var(--pastel-mint));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform, background-color, box-shadow;
    min-height: 60px;
}

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

/* Mobile touch feedback */
@media (max-width: 768px) {
    .memory-card:active {
        transform: scale(0.95);
        background: linear-gradient(45deg, var(--pastel-purple), var(--pastel-pink));
    }

    .memory-card.flipped:active {
        background: white;
        transform: scale(0.95);
    }

    .memory-card.matched:active {
        transform: scale(0.95);
    }
}

.memory-card.flipped {
    background: white;
    box-shadow: 0 4px 15px var(--shadow);
}

.memory-card.matched {
    background: linear-gradient(45deg, var(--pastel-green), var(--pastel-yellow));
    animation: bounce 0.4s ease;
}

/* Bento Game Styles */
.bento-workspace {
    display: grid;
    grid-template-columns: 220px 300px 320px;
    gap: 15px;
    margin: 20px auto;
    align-items: start;
    justify-content: center;
    width: fit-content;
}

.order-section {
    margin-bottom: 20px;
}

.order-display {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    margin-bottom: 15px;
}

.order-display h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
    text-align: center;
    font-size: 1rem;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.ingredient-emoji {
    font-size: 1rem;
}

.ingredient-name {
    flex: 1;
    margin: 0 8px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.ingredient-quantity {
    font-weight: bold;
    color: var(--pastel-blue);
    font-size: 0.9rem;
}

.score-display {
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    padding: 8px;
    background: var(--pastel-yellow);
    border-radius: 8px;
}

.score-display #score-value {
    color: var(--pastel-purple);
}

.ingredients-palette {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
}

.ingredient {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: grab;
    transition: transform 0.2s ease;
}

.ingredient:hover {
    transform: scale(1.1);
}

.ingredient:active {
    cursor: grabbing;
}

.bento-boxes {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bento-box {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);
    border: 3px solid var(--border-color);
    border-radius: 15px;
    position: relative;
    box-shadow: 0 4px 15px var(--shadow);
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(60px, auto);
    gap: 8px;
    padding: 12px;
}

.bento-box::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
}

.bento-box.filled {
    border-color: var(--pastel-green);
    background: linear-gradient(45deg, rgba(179, 255, 217, 0.2), rgba(255, 255, 179, 0.2));
}

.bento-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 2px dashed transparent;
    transition: all 0.2s ease;
    position: relative;
    min-height: 60px;
}

.bento-item:hover {
    border-color: var(--pastel-blue);
    background: rgba(179, 217, 255, 0.3);
}

/* Helper classes for item spans */
.bento-item.span-1 {
    grid-column: span 1;
}

.bento-item.span-2 {
    grid-column: span 2;
}

.bento-item.span-3 {
    grid-column: span 3;
}

/* Legacy bento-slot styles (for backward compatibility during transition) */
.bento-slot {
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px dashed transparent;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.bento-slot:hover {
    border-color: var(--pastel-blue);
    background: rgba(179, 217, 255, 0.3);
}

/* Variable slot sizes for authentic bento look */
.bento-slot .ingredient-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
}

/* Variable slot sizes for authentic bento look */
.bento-slot.slot-regular .ingredient-display {
    font-size: 1.2rem;
}

.bento-slot.slot-wide {
    background: linear-gradient(135deg, rgba(179, 217, 255, 0.2), rgba(179, 255, 217, 0.2));
}

.bento-slot.slot-wide .ingredient-display {
    font-size: 1.5rem;
}

.bento-slot.slot-tall {
    background: linear-gradient(135deg, rgba(255, 217, 179, 0.2), rgba(255, 255, 179, 0.2));
}

.bento-slot.slot-tall .ingredient-display {
    font-size: 1.5rem;
}

.bento-slot.slot-large {
    background: linear-gradient(135deg, rgba(255, 179, 217, 0.2), rgba(230, 179, 255, 0.2));
}

.bento-slot.slot-large .ingredient-display {
    font-size: 1.8rem;
}

/* Match-3 Game Styles */
.match3-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--bg-secondary), rgba(230, 179, 255, 0.2));
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
}

.match3-gem {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.match3-gem::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.match3-gem:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.match3-gem.selected {
    box-shadow: 0 0 0 4px var(--pastel-purple), 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
    z-index: 2;
}

.match3-gem.dragging {
    opacity: 0.5;
    transform: scale(1.1);
    z-index: 10;
}

.match3-gem.valid-drop {
    box-shadow: 0 0 0 4px var(--pastel-green);
    transform: scale(1.05);
}

.match3-gem.matching {
    animation: matchPulse 0.5s ease;
}

.match3-gem.swapping {
    animation: swapAnimation 0.3s ease;
}

.match3-gem.falling {
    animation: fallAnimation 0.3s ease;
}

.match3-gem.appearing {
    animation: appearAnimation 0.3s ease;
}

/* Mobile-specific gem styles */
@media (max-width: 768px) {
    .match3-gem:hover {
        transform: scale(1.02);
    }

    .match3-gem.selected {
        transform: scale(1.02);
    }

    /* Mobile touch feedback */
    .match3-gem:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .match3-gem.selected:active {
        transform: scale(0.95);
    }
}

/* Score Display */
.score-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.score-display, .combo-display {
    background: white;
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-label, .combo-label {
    font-weight: bold;
    color: var(--text-secondary);
}

.score-value, .combo-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--pastel-purple);
}

/* Match-3 Animations */
@keyframes matchPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 20px rgba(230, 179, 255, 0.8);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes swapAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fallAnimation {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes appearAnimation {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Present Reveal Styles */
.present-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
    z-index: 100;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    padding: 20px;
    box-sizing: border-box;
}

.present-container h2 {
    font-size: 2.5rem;
    margin: 20px 0;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple), var(--pastel-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--text-primary);
}

.present-body {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.present-body:hover {
    transform: scale(1.05);
}

.present-content {
    margin-top: 20px;
    text-align: center;
}

.card-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeInUp 0.8s ease-out;
}

.card-main-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-message {
    text-align: center;
    color: var(--text-primary);
}

.card-message h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple), var(--pastel-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-message p {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
}

/* Fullscreen Card Styles */
.fullscreen-card {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}


.fullscreen-card.active {
    opacity: 1;
}

.fullscreen-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    animation: cardReveal 1s ease-out;
}

.fullscreen-card-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    background: transparent;
}

.fullscreen-card-message {
    text-align: center;
    margin-top: 30px;
    color: #5D4E60;
}

.fullscreen-card-message h2 {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple), var(--pastel-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fullscreen-card-message p {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0;
}


/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes cardReveal {
    0% {
        transform: scale(0.8) rotate(-5deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Mobile-specific intro screen centering */
@media (max-width: 768px) {
    .intro-screen {
        min-height: 100dvh;
    }

    .container {
        min-height: 100dvh;
    }
}

/* Mobile Bottom Dock */
.mobile-ingredients-dock {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px var(--shadow);
    z-index: 1000;
    max-height: 50vh;
    transition: transform 0.3s ease;
}

.dock-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(45deg, var(--pastel-pink), var(--pastel-purple));
    color: white;
    border-radius: 20px 20px 0 0;
    cursor: pointer;
    user-select: none;
}

.dock-icon {
    font-size: 1.2rem;
}

.dock-text {
    font-weight: bold;
    font-size: 0.9rem;
}

.dock-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dock-arrow.rotated {
    transform: rotate(180deg);
}

.dock-content {
    max-height: 40vh;
    overflow-y: auto;
    padding: 15px;
    display: none;
}

.dock-content.open {
    display: block;
}

.mobile-ingredients-palette {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .progress-tracker {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .bento-workspace {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 80px; /* Space for bottom dock */
    }

    .bento-box {
        width: 280px;
        height: 280px;
    }

    .bento-slot {
        font-size: 1.2rem;
    }

    .bento-slot.slot-wide .ingredient-display,
    .bento-slot.slot-tall .ingredient-display {
        font-size: 1.3rem;
    }

    .bento-slot.slot-large .ingredient-display {
        font-size: 1.5rem;
    }

    /* Hide desktop ingredients palette on mobile */
    .ingredients-palette {
        display: none;
    }

    /* Show mobile bottom dock */
    .mobile-ingredients-dock {
        display: block;
    }

    .mobile-ingredients-palette .ingredient {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .order-display {
        padding: 12px;
    }

    .order-item {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .ingredient-emoji {
        font-size: 1.2rem;
    }

    .ingredient-name {
        font-size: 0.85rem;
    }

    .ingredient-quantity {
        font-size: 0.95rem;
    }

    .memory-board {
        grid-template-columns: repeat(4, 1fr);
        max-width: 320px;
        gap: 8px;
    }

    .memory-card {
        font-size: 1.5rem;
        min-height: 50px;
    }

    .present-body {
        width: 150px;
        height: 150px;
        font-size: 3rem;
    }

    /* Match-3 Game Mobile Styles */
    .match3-board {
        max-width: 320px;
        padding: 12px;
        gap: 6px;
    }

    .match3-gem {
        font-size: 1.5rem;
    }

    /* Adjust game container for mobile */
    #match3-game {
        padding: 20px;
    }

    #match3-game .game-header {
        margin-bottom: 20px;
    }

    #match3-game .game-header h2 {
        font-size: 1.6rem;
    }

    #match3-game .game-controls {
        margin-top: 15px;
    }

    /* Viewport height optimization for mobile */
    #match3-game {
        min-height: calc(100vh - 40px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
    }

    #match3-game .game-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .memory-board {
        max-width: 280px;
        gap: 6px;
    }

    .memory-card {
        font-size: 1.2rem;
        min-height: 45px;
        border-radius: 12px;
    }

    /* Match-3 Game Small Mobile Styles */
    .match3-board {
        max-width: 280px;
        padding: 10px;
        gap: 5px;
    }

    .match3-gem {
        font-size: 1.2rem;
    }

    #match3-game {
        padding: 15px;
    }

    #match3-game .game-header h2 {
        font-size: 1.4rem;
    }

    #match3-game .game-header p {
        font-size: 1rem;
    }

    /* Adjust score display for small mobile */
    .score-container {
        gap: 8px;
        margin: 15px 0;
    }

    .score-display,
    .combo-display {
        padding: 6px 12px;
        min-width: 0; /* Allow shrinking */
    }

    .score-display {
        flex: 2; /* Score gets more space */
    }

    .combo-display {
        flex: 1; /* Combo gets less space */
    }

    .score-label,
    .combo-label {
        font-size: 0.8rem;
    }

    .score-value,
    .combo-value {
        font-size: 0.9rem;
    }

    /* Enhanced mobile viewport optimization */
    #match3-game {
        min-height: calc(100vh - 30px);
        padding: 10px;
    }

    #match3-game .game-header {
        margin-bottom: 15px;
    }

    #match3-game .game-header h2 {
        font-size: 1.3rem;
    }

    /* Enhanced touch feedback for small screens */
    .match3-gem:active {
        transform: scale(0.92);
        box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
    }

    /* Better visual feedback for touch interactions */
    .match3-gem.valid-drop {
        transform: scale(1.08);
        box-shadow: 0 0 0 3px var(--pastel-green), 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    /* Mobile performance optimizations */
    .match3-board {
        will-change: transform;
        transform: translateZ(0);
    }

    .match3-gem {
        will-change: transform, opacity;
        transform: translateZ(0);
    }

    /* Prevent scrolling during game interactions */
    body.match3-active {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}

    
    .card-display {
        gap: 15px;
    }

    .card-main-image {
        max-height: 50vh;
    }

    .card-message h2 {
        font-size: 1.5rem;
    }

    .card-message p {
        font-size: 1.1rem;
    }

    .fullscreen-card-message {
        margin-top: 20px;
    }

    .fullscreen-card-message h2 {
        font-size: 2rem;
    }

    .fullscreen-card-message p {
        font-size: 1.4rem;
    }

    /* Fallback Card Mobile Styles */
    .card-fallback {
        height: 350px;
        max-width: 90%;
    }

    .card-content {
        padding: 20px;
    }

    .card-content h2 {
        font-size: 2rem;
    }

    .card-heart {
        font-size: 3rem;
    }

    .card-content p {
        font-size: 1.2rem;
    }

/* Mobile-specific fullscreen optimizations */
@media (max-width: 768px) and (orientation: portrait) {
    .fullscreen-card {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
    }

    .fullscreen-card-content {
        height: 100vh;
        height: 100dvh;
    }

    .fullscreen-card-image {
        max-height: 95vh;
        max-height: 95dvh;
        max-width: 95vw;
        object-fit: contain;
    }
}

/* Handle mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .fullscreen-card {
        height: 100vh;
        height: 100dvh;
    }

    .fullscreen-card-image {
        object-fit: contain;
        height: 100vh;
        height: 100dvh;
    }
}
