/* TBACS ABCs with U and Me! Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka', 'Comic Neue', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    padding-top: 60px; /* Space for nav */
}

/* Game Navigation */
.game-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 9999;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 14px;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.back-btn svg {
    transition: transform 0.3s;
}

.back-btn:hover svg {
    transform: translateX(-3px);
}

.game-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    flex: 1;
}

.game-logo {
    width: 40px;
    height: 40px;
    animation: float 3s ease-in-out infinite;
}

/* Container Layout */
.container {
    display: flex;
    width: 100vw;
    height: calc(100vh - 60px); /* Account for nav height */
    gap: 20px;
    padding: 20px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 40px);
}

/* Ensure sidebar scrolls smoothly */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.sidebar-title {
    font-size: 24px;
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

.magnets-container {
    background: #f0f0f0;
    border-radius: 15px;
    padding: 10px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-content: flex-start;
    position: relative;
}

/* Custom scrollbar for magnets container */
.magnets-container::-webkit-scrollbar {
    width: 8px;
}

.magnets-container::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

.magnets-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.magnets-container::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-hint {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    flex-shrink: 0;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

.btn-hint {
    background: linear-gradient(135deg, #fa709a, #fee140);
    color: white;
}

.btn-hint:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(250, 112, 154, 0.4);
}

.btn-hint:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Score and Streak Display */
.score-display, .streak-display {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.score-label, .streak-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.score-value, .streak-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.streak-value {
    color: #ff6b6b;
}

/* Fridge Container */
.fridge-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Target Word Display */
.target-word-display {
    background: white;
    border-radius: 20px;
    padding: 15px 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.target-label {
    font-size: 20px;
    color: #666;
}

.target-word {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.word-preview {
    display: flex;
    gap: 5px;
    margin-left: 20px;
}

.preview-letter {
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #999;
}

.preview-letter.filled {
    background: #4caf50;
    color: white;
    animation: popIn 0.3s;
}

/* The Fridge - Container */
.fridge {
    width: 380px;
    height: 650px;
    position: relative;
    perspective: 1500px;
    transform-style: preserve-3d;
}

/* Fridge Interior */
.fridge-interior {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
    border: 2px solid #9e9e9e;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.1);
}

/* Shelves */
.shelf {
    flex: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    background: linear-gradient(180deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(255,255,255,0) 10%);
    border-bottom: 8px solid #e0e0e0;
    box-shadow: 
        0 8px 15px rgba(0,0,0,0.15),
        inset 0 -3px 5px rgba(0,0,0,0.05);
}

.shelf:last-child {
    border-bottom: none;
    box-shadow: inset 0 -3px 5px rgba(0,0,0,0.05);
}

/* Shelf edge (3D effect) */
.shelf::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg,
        #bdbdbd 0%,
        #e0e0e0 50%,
        #bdbdbd 100%);
    border-bottom: 1px solid #9e9e9e;
}

.shelf:last-child::before {
    display: none;
}

/* Shelf shadow underneath */
.shelf::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0.15), transparent);
    z-index: -1;
}

/* Fridge Light */
.fridge-light {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 15px;
    background: linear-gradient(180deg, #fff59d, #ffeb3b);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 30px rgba(255, 235, 59, 0.6);
}

/* Food Items - Realistic CSS Styling */

/* Food Items - Make them draggable */
.food-item {
    cursor: move;
    transition: transform 0.2s, opacity 0.2s;
}

.food-item:hover {
    transform: scale(1.05);
}

.food-item:active {
    cursor: grabbing;
}

/* Milk Carton */
.milk-carton {
    width: 50px;
    height: 70px;
    position: relative;
}

.carton-top {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 20px solid #e3f2fd;
    position: relative;
}

.carton-body {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #1976d2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Juice Box */
.juice-box {
    width: 45px;
    height: 60px;
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    border: 1px solid #ff6f00;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.juice-label {
    background: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    color: #ff6f00;
}

/* Soda Can */
.soda-can {
    width: 35px;
    height: 60px;
    position: relative;
}

.can-top {
    width: 35px;
    height: 8px;
    background: #bdbdbd;
    border-radius: 50%;
    border: 1px solid #757575;
}

.can-body {
    width: 35px;
    height: 50px;
    background: linear-gradient(180deg, #d32f2f, #b71c1c);
    border-radius: 3px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Egg Carton */
.egg-carton {
    width: 80px;
    height: 40px;
    background: #f5f5dc;
    border: 1px solid #d2b48c;
    border-radius: 5px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    padding: 5px;
    gap: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.egg {
    width: 18px;
    height: 14px;
    background: radial-gradient(ellipse at center, #fff8e1, #ffecb3);
    border-radius: 50% 50% 60% 60%;
    border: 1px solid #ffe0b2;
    box-shadow: inset 0 -2px 3px rgba(0,0,0,0.1);
}

/* Butter Box */
.butter-box {
    width: 60px;
    height: 25px;
    background: linear-gradient(180deg, #fff9c4, #ffeb3b);
    border: 1px solid #f9a825;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.butter-label {
    font-size: 10px;
    font-weight: bold;
    color: #f57c00;
}

/* Cheese Wedge */
.cheese-wedge {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-bottom: 35px solid #ffeb3b;
    border-right: 0;
    position: relative;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.cheese-wedge::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -35px;
    width: 8px;
    height: 8px;
    background: #fff59d;
    border-radius: 50%;
    box-shadow: 
        12px 5px 0 3px #fff59d,
        20px -5px 0 2px #fff59d;
}

/* Pizza Box */
.pizza-box {
    width: 70px;
    height: 50px;
    background: linear-gradient(135deg, #8d6e63, #6d4c41);
    border: 2px solid #5d4037;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    transform: perspective(100px) rotateX(5deg);
}

.pizza-label {
    background: #d32f2f;
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    transform: rotate(-3deg);
}

/* Leftover Container */
.leftover-container {
    width: 50px;
    height: 35px;
    position: relative;
}

.container-lid {
    width: 50px;
    height: 8px;
    background: linear-gradient(180deg, #64b5f6, #2196f3);
    border-radius: 3px 3px 0 0;
    border: 1px solid #1976d2;
}

.container-body {
    width: 50px;
    height: 25px;
    background: rgba(100, 181, 246, 0.3);
    border: 1px solid #2196f3;
    border-top: none;
    border-radius: 0 0 3px 3px;
    margin-top: 2px;
}

/* Yogurt Cup */
.yogurt-cup {
    width: 35px;
    height: 40px;
    position: relative;
}

.yogurt-lid {
    width: 35px;
    height: 3px;
    background: #e0e0e0;
    border-radius: 50% 50% 0 0;
    border: 1px solid #9e9e9e;
}

.yogurt-body {
    width: 30px;
    height: 35px;
    background: linear-gradient(180deg, #fff, #f5f5f5);
    border: 1px solid #e0e0e0;
    border-radius: 0 0 15% 15%;
    margin: 2px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #e91e63;
    font-weight: bold;
}

/* Crisper Drawer */
.shelf-drawer {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #bdbdbd;
    border-radius: 5px;
    padding: 10px;
    position: relative;
}

.drawer-handle {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #9e9e9e;
    border-radius: 2px;
}

/* Vegetables and Fruits */
.vegetable, .fruit {
    width: 30px;
    height: 30px;
    position: relative;
    display: inline-block;
}

.lettuce {
    background: radial-gradient(circle, #81c784, #4caf50);
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(46, 125, 50, 0.3);
}

.carrot {
    width: 8px;
    height: 30px;
    background: linear-gradient(180deg, #ff9800, #ff6d00);
    border-radius: 2px 2px 40% 40%;
    transform: rotate(5deg);
}

.carrot::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -2px;
    width: 12px;
    height: 8px;
    background: #4caf50;
    border-radius: 50% 50% 0 0;
    opacity: 0.8;
}

.tomato {
    background: radial-gradient(circle at 30% 30%, #ff5252, #d32f2f);
    border-radius: 45% 55% 60% 40%;
    box-shadow: inset -2px -2px 5px rgba(183, 28, 28, 0.3);
}

.tomato::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 5px;
    background: #4caf50;
    border-radius: 50%;
}

.apple {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #d32f2f);
    border-radius: 50% 50% 60% 60%;
    box-shadow: inset -3px -3px 8px rgba(183, 28, 28, 0.3);
}

.apple::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: #795548;
    border-radius: 1px;
}

.apple::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 55%;
    width: 8px;
    height: 6px;
    background: #4caf50;
    border-radius: 0 100% 0 100%;
    transform: rotate(45deg);
}

/* Fridge Door */
.fridge-door-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        #f5f5f5 0%, 
        #e0e0e0 3%, 
        #f5f5f5 6%, 
        #eeeeee 100%);
    border: 2px solid #9e9e9e;
    border-radius: 8px;
    box-shadow: 
        inset 0 2px 10px rgba(255, 255, 255, 0.8),
        inset 0 -2px 10px rgba(0, 0, 0, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px #bdbdbd;
    transform-origin: left center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    transform-style: preserve-3d;
}

/* Open State */
.fridge-door-front.open {
    transform: rotateY(-120deg);
}

/* Hide drop zone indicator when door is open */
.fridge-door-front.open .drop-zone-indicator {
    display: none !important;
}

/* Keep handle and eyes always visible */
.handle, .eyes, .eye, .pupil {
    backface-visibility: visible !important;
}

/* Always hide the door back face - we don't need it */
.door-back {
    display: none !important;
}

/* Door Faces */
.door-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.door-front {
    z-index: 2;
    backface-visibility: hidden;
}

.door-back {
    transform: rotateY(180deg);
    backface-visibility: hidden;
    background: linear-gradient(180deg, #fafafa, #f0f0f0);
    border: 2px solid #9e9e9e;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Door Shelves (inside door) */
.door-shelf {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* Condiments */
.condiment {
    width: 25px;
    height: 40px;
    border-radius: 3px;
    position: relative;
}

.ketchup {
    background: linear-gradient(180deg, #f44336, #c62828);
    border: 1px solid #b71c1c;
}

.ketchup::after {
    content: 'K';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.mustard {
    background: linear-gradient(180deg, #ffeb3b, #fbc02d);
    border: 1px solid #f9a825;
}

.mustard::after {
    content: 'M';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #795548;
    font-size: 10px;
    font-weight: bold;
}

.mayo {
    background: linear-gradient(180deg, #fff, #f5f5f5);
    border: 1px solid #e0e0e0;
}

.mayo::after {
    content: 'M';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #2196f3;
    font-size: 10px;
    font-weight: bold;
}

/* Door Bottles */
.door-bottle {
    width: 30px;
    height: 50px;
    border-radius: 3px 3px 10px 10px;
    position: relative;
}

.water {
    background: linear-gradient(180deg, 
        rgba(33, 150, 243, 0.3),
        rgba(33, 150, 243, 0.5));
    border: 1px solid #2196f3;
}

.water::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 8px;
    background: #2196f3;
    border-radius: 2px;
}

.juice-small {
    background: linear-gradient(180deg, #fff176, #fbc02d);
    border: 1px solid #f9a825;
}

.juice-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 8px;
    background: #f57c00;
    border-radius: 2px;
}

/* Door Freezer Divider Line */
.door-front::after {
    content: '';
    position: absolute;
    top: 35%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(180deg, #9e9e9e, #bdbdbd, #9e9e9e);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
    z-index: 1;
}

/* Fridge Eyes */
.eyes {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    z-index: 10;
}

.eye {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    border: 3px solid #333;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.pupil {
    width: 20px;
    height: 20px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease-out;
}

.pupil::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    top: 5px;
    right: 5px;
}

/* Handle - Realistic Stainless Steel */
.handle {
    position: absolute;
    right: 20px;
    top: 15%;
    width: 12px;
    height: 80px;
    background: linear-gradient(90deg, 
        #757575 0%, 
        #e0e0e0 20%, 
        #bdbdbd 40%,
        #e0e0e0 60%,
        #9e9e9e 80%,
        #757575 100%);
    border-radius: 4px;
    box-shadow: 
        2px 0 5px rgba(0, 0, 0, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.5),
        inset -1px 0 1px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    z-index: 101;
}

.handle:hover {
    transform: scale(1.1);
    box-shadow: 
        2px 0 8px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(102, 126, 234, 0.3),
        inset 1px 0 1px rgba(255, 255, 255, 0.5),
        inset -1px 0 1px rgba(0, 0, 0, 0.2);
}

/* Handle bracket top */
.handle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -6px;
    width: 20px;
    height: 10px;
    background: linear-gradient(180deg, #9e9e9e, #757575);
    border-radius: 2px 2px 0 0;
}

/* Handle bracket bottom */
.handle::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: -6px;
    width: 20px;
    height: 10px;
    background: linear-gradient(180deg, #757575, #9e9e9e);
    border-radius: 0 0 2px 2px;
}

/* Spelling Area */
.spelling-area {
    width: 600px;
    min-height: 100px;
    background: white;
    border: 4px dashed #90a4ae;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    transition: all 0.3s;
    position: relative;
}

.spelling-area.highlight {
    border-color: #4caf50;
    background: #e8f5e9;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

.spelling-area.error {
    animation: shake 0.5s;
    border-color: #f44336;
    background: #ffebee;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.spelling-placeholder {
    color: #999;
    font-size: 18px;
    position: absolute;
}

.spelling-area:has(.magnet) .spelling-placeholder {
    display: none;
}

/* Drop Zone Indicator */
.drop-zone-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 600;
    animation: pulse 1s infinite;
    z-index: 100;
}

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

/* Game Controls */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 5px 0;
    flex-shrink: 0;
}

.mode-selector, .difficulty-selector {
    padding: 8px;
    border-radius: 8px;
    border: 2px solid #667eea;
    background: white;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-selector:hover, .difficulty-selector:hover {
    background: #667eea;
    color: white;
}

/* Timer Display */
.timer-display {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(255, 82, 82, 0.3);
    animation: pulse 1s infinite;
    flex-shrink: 0;
}

.timer-label {
    font-size: 14px;
    color: white;
    margin-bottom: 5px;
}

.timer-value {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

/* Power-up Indicators */
.powerup-indicators {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 5px 0;
    flex-shrink: 0;
}

.powerup-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    animation: float 2s ease-in-out infinite;
}

.powerup-icon.active {
    display: flex;
}

.gold-powerup {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.rainbow-powerup {
    background: linear-gradient(135deg, #ff0080, #ff8c00, #ffd700, #00ff00, #00ffff, #0080ff, #8000ff);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.freeze-powerup {
    background: linear-gradient(135deg, #00bfff, #87ceeb);
    box-shadow: 0 0 20px rgba(135, 206, 235, 0.6);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Combo Display */
.combo-display {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 15px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
    animation: comboGlow 0.5s ease-in-out;
    flex-shrink: 0;
}

.combo-text {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.combo-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

.combo-bar::before {
    content: '';
    display: block;
    height: 100%;
    background: white;
    border-radius: 3px;
    animation: comboTimer 3s linear;
}

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

@keyframes comboTimer {
    from { width: 100%; }
    to { width: 0%; }
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin: 5px 0;
    flex-shrink: 0;
}

.theme-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
}

.theme-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.theme-btn.active {
    background: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.7);
}

/* Magnets */
.magnet {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 
        2px 2px 0 rgba(0, 0, 0, 0.3),
        -1px -1px 0 rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: move;
    cursor: grab;
    transition: transform 0.2s;
    box-shadow: 
        0 3px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
    -webkit-user-drag: element;
    user-select: none;
    position: relative;
}

/* Special Letter Effects */
.magnet.gold-letter {
    background: linear-gradient(135deg, #ffd700, #ffed4e) !important;
    animation: goldShine 2s infinite;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 3px 10px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.magnet.rainbow-letter {
    background: linear-gradient(135deg, #ff0080, #ff8c00, #ffd700, #00ff00, #00ffff, #0080ff, #8000ff) !important;
    animation: rainbowShift 3s infinite;
    box-shadow: 
        0 0 25px rgba(255, 255, 255, 0.9),
        0 3px 10px rgba(0, 0, 0, 0.3);
}

.magnet.hint-glow {
    animation: hintPulse 1s infinite;
}

@keyframes goldShine {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(5deg); }
}

@keyframes rainbowShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes hintPulse {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.5),
                    0 3px 10px rgba(0, 0, 0, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(76, 175, 80, 1),
                    0 3px 10px rgba(0, 0, 0, 0.3);
        transform: scale(1.1);
    }
}

/* Magnets on the fridge door */
.fridge-door-front .magnet {
    position: absolute !important;
    z-index: 102;
}

/* Hide magnets when door is open */
.fridge-door-front.open .magnet {
    display: none;
}

.magnet:hover {
    transform: scale(1.1) rotate(-2deg);
}

.magnet.dragging {
    cursor: grabbing;
    transform: scale(1.15) rotate(5deg);
    z-index: 1000;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* Magnet Colors */
.magnet-red { background: linear-gradient(135deg, #ff6b6b, #ff5252); }
.magnet-blue { background: linear-gradient(135deg, #4dabf5, #339af0); }
.magnet-green { background: linear-gradient(135deg, #51cf66, #40c057); }
.magnet-yellow { background: linear-gradient(135deg, #ffd43b, #fab005); }
.magnet-purple { background: linear-gradient(135deg, #9775fa, #7950f2); }
.magnet-orange { background: linear-gradient(135deg, #ff922b, #fd7e14); }
.magnet-pink { background: linear-gradient(135deg, #f06595, #e64980); }
.magnet-teal { background: linear-gradient(135deg, #20c997, #12b886); }

/* Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.popup-content {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    animation: popUp 0.5s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes popUp {
    from {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

#popup-message {
    font-size: 36px;
    color: #333;
    margin: 20px 0 10px;
}

#popup-submessage {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.popup-score {
    font-size: 32px;
    font-weight: 700;
    color: #4caf50;
    margin: 20px 0;
}

.popup-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.popup-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Particle Effects */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1999;
}

.particle {
    position: absolute;
    font-size: 30px;
    animation: floatUp 3s ease-out forwards;
}

@keyframes floatUp {
    to {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Stars for Space Theme */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Snowflakes for Christmas Theme */
.snowflake {
    position: absolute;
    color: white;
    font-size: 20px;
    animation: snowfall 10s linear infinite;
}

@keyframes snowfall {
    from {
        transform: translateY(-100vh) rotate(0deg);
    }
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Power-up Effect Animation */
@keyframes powerUpFly {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -150%) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -250%) scale(0.5);
        opacity: 0;
    }
}

/* Mode Instruction Animation */
@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Fridge Personality Animations */
.fridge.happy {
    animation: fridgeHappy 0.5s ease-in-out;
}

.fridge.sad {
    animation: fridgeSad 0.5s ease-in-out;
}

.fridge.excited {
    animation: fridgeExcited 0.5s ease-in-out infinite;
}

.fridge.sleeping .eyes {
    animation: eyesBlink 4s infinite;
}

@keyframes fridgeHappy {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.02) rotate(-2deg); }
    75% { transform: scale(1.02) rotate(2deg); }
}

@keyframes fridgeSad {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(0.98) translateY(5px); }
}

@keyframes fridgeExcited {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px) rotate(-2deg); }
    75% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes eyesBlink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

/* Speech Bubble for Fridge */
.speech-bubble {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    animation: bubblePop 0.5s ease-out;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

@keyframes bubblePop {
    from {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

/* Confetti Effect */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confettiFall 3s ease-out forwards;
}

.confetti:nth-child(even) {
    background: #4ecdc4;
    width: 8px;
    height: 8px;
}

.confetti:nth-child(3n) {
    background: #ffe66d;
    width: 12px;
    height: 12px;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        touch-action: pan-y;
    }
    
    /* Mobile Navigation */
    .game-nav {
        padding: 0 10px;
    }
    
    .game-title {
        font-size: 16px;
        display: none; /* Hide on very small screens */
    }
    
    .back-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .game-logo {
        width: 35px;
        height: 35px;
    }
    
    @media (min-width: 480px) {
        .game-title {
            display: block;
            font-size: 18px;
        }
    }
    
    .container {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
        height: auto;
        min-height: 100vh;
    }
    
    /* Sidebar becomes horizontal */
    .sidebar {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        flex-direction: column;
        padding: 15px;
        gap: 10px;
        order: 2; /* Move to bottom */
    }
    
    .sidebar-title {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .magnets-container {
        min-height: 100px;
        max-height: 120px;
        overflow-y: auto;
        gap: 5px;
        padding: 8px;
    }
    
    /* Hide some elements on mobile to save space */
    .powerup-indicators {
        display: none;
    }
    
    .theme-selector {
        position: fixed;
        bottom: 10px;
        right: 10px;
        z-index: 100;
        background: white;
        padding: 5px;
        border-radius: 25px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    }
    
    /* Buttons in row */
    .sidebar .btn-primary, 
    .sidebar .btn-secondary, 
    .sidebar .btn-hint {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Score and streak in row */
    .score-display, .streak-display {
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        width: calc(50% - 5px);
        padding: 10px;
    }
    
    .score-label, .streak-label {
        font-size: 12px;
        margin-bottom: 0;
    }
    
    .score-value, .streak-value {
        font-size: 24px;
    }
    
    /* Main game area */
    .fridge-container {
        order: 1; /* Move to top */
        gap: 15px;
        padding: 0;
    }
    
    /* Target word */
    .target-word-display {
        padding: 10px 20px;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .target-label {
        font-size: 16px;
    }
    
    .target-word {
        font-size: 24px;
        letter-spacing: 3px;
    }
    
    .word-preview {
        display: none; /* Hide on mobile to save space */
    }
    
    /* Fridge sizing */
    .fridge {
        width: 90vw;
        max-width: 350px;
        height: 280px;
    }
    
    /* Scale down fridge interior items */
    .fridge-interior {
        padding: 10px;
    }
    
    .milk-carton {
        width: 35px;
        height: 50px;
    }
    
    .carton-top {
        border-left: 17px solid transparent;
        border-right: 17px solid transparent;
        border-bottom: 15px solid #e3f2fd;
    }
    
    .carton-body {
        width: 35px;
        height: 35px;
        font-size: 8px;
    }
    
    .juice-box {
        width: 30px;
        height: 45px;
    }
    
    .juice-label {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .soda-can {
        width: 25px;
        height: 45px;
    }
    
    .can-top {
        width: 25px;
        height: 6px;
    }
    
    .can-body {
        width: 25px;
        height: 37px;
        font-size: 7px;
    }
    
    .egg-carton {
        width: 60px;
        height: 30px;
        padding: 3px;
        gap: 2px;
    }
    
    .egg {
        width: 14px;
        height: 11px;
    }
    
    .butter-box {
        width: 45px;
        height: 20px;
    }
    
    .butter-label {
        font-size: 8px;
    }
    
    .cheese-wedge {
        border-left: 30px solid transparent;
        border-bottom: 25px solid #ffeb3b;
    }
    
    .pizza-box {
        width: 50px;
        height: 35px;
    }
    
    .pizza-label {
        font-size: 8px;
        padding: 2px 5px;
    }
    
    .leftover-container {
        width: 35px;
        height: 25px;
    }
    
    .container-lid {
        width: 35px;
        height: 6px;
    }
    
    .container-body {
        width: 35px;
        height: 18px;
    }
    
    .yogurt-cup {
        width: 25px;
        height: 30px;
    }
    
    .yogurt-body {
        width: 22px;
        height: 25px;
        font-size: 6px;
    }
    
    .vegetable, .fruit {
        width: 22px;
        height: 22px;
    }
    
    .carrot {
        width: 6px;
        height: 22px;
    }
    
    /* Door items */
    .condiment {
        width: 20px;
        height: 30px;
    }
    
    .condiment::after {
        font-size: 8px;
    }
    
    .door-bottle {
        width: 22px;
        height: 38px;
    }
    
    /* Fridge eyes */
    .eyes {
        gap: 30px;
        top: 15px;
    }
    
    .eye {
        width: 35px;
        height: 35px;
        border: 2px solid #333;
    }
    
    .pupil {
        width: 15px;
        height: 15px;
    }
    
    .pupil::after {
        width: 4px;
        height: 4px;
        top: 3px;
        right: 3px;
    }
    
    /* Handle */
    .handle {
        right: 15px;
        top: 20%;
        width: 10px;
        height: 60px;
    }
    
    /* Spelling area */
    .spelling-area {
        width: 90vw;
        max-width: 350px;
        min-height: 80px;
        padding: 15px;
        border: 3px dashed #90a4ae;
    }
    
    .spelling-placeholder {
        font-size: 14px;
    }
    
    /* Magnets */
    .magnet {
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 22px;
        border-radius: 6px;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        touch-action: none;
    }
    
    /* Popup adjustments */
    .popup-content {
        max-width: 90%;
        padding: 30px 20px;
    }
    
    #popup-message {
        font-size: 28px;
    }
    
    #popup-submessage {
        font-size: 16px;
    }
    
    .popup-score {
        font-size: 24px;
    }
    
    .popup-btn {
        padding: 12px 30px;
        font-size: 18px;
    }
    
    /* Drop zone indicator */
    .drop-zone-indicator {
        font-size: 16px;
        padding: 10px 20px;
    }
}