        :root {
            --primary: #1e90ff;
            --primary-light: #4dabf7;
            --secondary: #2ecc71;
            --secondary-light: #51cf66;
            --danger: #ff4d4f;
            --danger-light: #ff6b6b;
            --warning: #ffa94d;
            --warning-light: #ffc078;
            --dark: #1e272e;
            --dark-light: #495057;
            --light: #f1f3f5;
            --light-dark: #dee2e6;
            --white: #ffffff;
            --gray: #868e96;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }

        body {
            background: linear-gradient(145deg, #0b7285, #1864ab);
            color: var(--dark);
            line-height: 1.6;
            min-height: 100vh;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container {
            max-width: 1400px;
            width: 100%;
            background: var(--white);
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            padding: 30px;
            position: relative;
            overflow: hidden;
        }

        header {
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--light-dark);
        }

        h1 {
            font-size: 2.5rem;
            font-weight: 700;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 10px;
        }

        .description {
            font-size: 1.1rem;
            color: var(--gray);
            max-width: 700px;
            margin: 0 auto;
            line-height: 1.7;
        }

        .selection-area {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-bottom: 30px;
        }

        .food-selection, .time-selection, .condition-selection {
            background: var(--light);
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }

        .food-selection:hover, .time-selection:hover, .condition-selection:hover {
            transform: translateY(-4px);
        }

        h2 {
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        h2 i {
            font-size: 1.5rem;
            color: var(--primary);
        }

        .food-options, .time-options, .condition-options {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .option {
            padding: 15px;
            background: var(--white);
            border: 1px solid var(--light-dark);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            flex: 1;
            min-width: 100px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .option:hover {
            transform: translateY(-4px);
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
            border-color: var(--primary);
        }

        .option.active {
            background: linear-gradient(135deg, var(--primary), var(--primary-light));
            color: var(--white);
            border-color: var(--primary);
            box-shadow: 0 6px 12px rgba(30, 144, 255, 0.3);
        }

        .option.active i, .option.active span {
            color: var(--white);
        }

        .option i {
            font-size: 1.8rem;
            transition: transform 0.3s ease;
        }

        .option:hover i {
            transform: scale(1.1);
        }

        .option span {
            font-size: 0.95rem;
            font-weight: 500;
        }

        .temperature-slider {
            margin-top: 15px;
            padding: 0 10px;
        }

        .temperature-slider label {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--dark);
            display: block;
            margin-bottom: 5px;
        }

        .temperature-slider input[type="range"] {
            width: 100%;
            accent-color: var(--primary);
        }

        .temperature-value {
            font-size: 0.9rem;
            color: var(--gray);
            text-align: center;
            margin-top: 5px;
        }

        .simulation-area {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            align-items: start;
        }

        .food-display-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .day-indicator {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--dark);
            background: var(--light);
            padding: 10px 20px;
            border-radius: 20px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .day-indicator i {
            color: var(--primary);
        }

        .spoilage-bar {
            width: 100%;
            max-width: 320px;
            background: var(--light-dark);
            border-radius: 10px;
            overflow: hidden;
            height: 20px;
            position: relative;
        }

        .spoilage-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--warning), var(--danger));
            transition: width 0.5s ease;
        }

        .spoilage-bar-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--white);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        }

        .food-display {
            width: 320px;
            height: 320px;
            position: relative;
            overflow: hidden;
            border-radius: 15px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
            background: var(--light);
            z-index: 1;
        }

        .food-item {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.5s ease, opacity 0.3s ease;
            z-index: 2;
        }

        .food-item.changing {
            opacity: 0;
        }

        .cheese {
            background: linear-gradient(135deg, #fab005, #f08c00);
            clip-path: polygon(50% 100%, 0 0, 100% 0);
            box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5);
        }

        .apple {
            background: linear-gradient(135deg, #ff6b6b, #c92f2f);
            clip-path: circle(50% at 50% 50%);
            box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3);
        }

        .bread {
            background: linear-gradient(135deg, #e67700, #d9480f);
            clip-path: polygon(10% 70%, 20% 35%, 35% 20%, 50% 15%, 65% 20%, 80% 35%, 90% 70%, 90% 100%, 10% 100%);
            box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3);
        }

.yogurt {
      top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: relative;
  width: 200px;
  height: 220px;
  background: linear-gradient(180deg, #d0ebff 0%, #f5fbff 100%);
  clip-path: polygon(30px 0, 170px 0, 190px 220px, 10px 220px);
  border: 4px solid #a3d2ff;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* Phần sữa bên trong */
.yogurt::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65%;
  background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
  clip-path: polygon(10px 0, 190px 0, 180px 140px, 20px 140px);
  border-radius: 10px 10px 0 0;
}

/* Nắp sữa chua */
.yogurt::after {
  content: "";
  position: absolute;
  top: -25px;
  left: -10px;
  width: 220px;
  height: 50px;
  background: linear-gradient(135deg, #cce8ff, #e0f4ff);
  clip-path: polygon(0 50%, 20px 0, 200px 0, 220px 50%);
  border: 3px solid #a3d2ff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}


        .soup {
            background: linear-gradient(135deg, #f76707, #d9480f);
            border-radius: 0 0 30px 30px;
            box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3);
        }

        .pork {
            background: linear-gradient(135deg, #ff8787, #d63031);
            clip-path: polygon(20% 20%, 80% 20%, 90% 80%, 10% 80%);
            box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.3);
        }

        .fish {
                  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 150px;
  background: linear-gradient(90deg, #b7e2ff 0%, #7fc8ff 40%, #5ca9ff 70%, #3a7cff 100%);
  clip-path: path("M10,75 C50,20 200,20 280,75 C200,130 50,130 10,75 Z"); 
  border-radius: 20px;
  box-shadow:
    inset -8px 0 20px rgba(0, 0, 0, 0.2),
    0 8px 25px rgba(0, 0, 0, 0.25);
        }
.fish::before {
  content: "";
  position: absolute;
  left: 35px;
  top: 55px;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 40% 40%, #fff 40%, #ccc 80%);
  border-radius: 50%;
  border: 2px solid #333;
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
  z-index: 3;
}
.fish::after {
  content: "";
  position: absolute;
  left: 45px;
  top: 65px;
  width: 12px;
  height: 12px;
  background: black;
  border-radius: 50%;
  box-shadow: 1px 1px 2px rgba(255,255,255,0.3) inset;
  z-index: 4;
}


        .food-name {
            font-size: 1.8rem;
            font-weight: 600;
            color: var(--white);
            text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
            z-index: 3;
            padding: 8px 16px;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 8px;
        }

        .microbes {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 2;
        }

        .microbe {
            position: absolute;
            border-radius: 50%;
            opacity: 0;
            transform: translate3d(0, 0, 0);
            animation: float 10s infinite linear;
        }

        @keyframes float {
            0% {
                transform: translate3d(0, 0, 0) rotate(0deg);
            }
            100% {
                transform: translate3d(calc(100px * var(--tx)), calc(100px * var(--ty)), 0) rotate(360deg);
            }
        }

        .info-panel {
            background: var(--light);
            padding: 20px;
            border-radius: 12px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .info-title {
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .info-title i {
            color: var(--secondary);
            font-size: 1.6rem;
        }

        .info-content {
            line-height: 1.7;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
            font-size: 0.95rem;
        }

        .microbe-info, .benefits, .harm {
            padding: 15px;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .microbe-info {
            background: var(--white);
            border-left: 4px solid var(--primary);
        }

        .benefits {
            background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(46, 204, 113, 0.05));
            border-left: 4px solid var(--secondary);
        }

        .harm {
            background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
            border-left: 4px solid var(--danger);
        }

        .microbe-info h4, .benefits h4, .harm h4 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--dark);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .benefits li, .harm li {
            list-style-type: none;
            margin-bottom: 8px;
            padding-left: 25px;
            position: relative;
        }

        .benefits li {
            color: var(--secondary);
        }

        .benefits li:before {
            content: "✓";
            position: absolute;
            left: 0;
            color: var(--secondary);
            font-weight: bold;
        }

        .harm li {
            color: var(--danger);
        }

        .harm li:before {
            content: "✗";
            position: absolute;
            left: 0;
            color: var(--danger);
            font-weight: bold;
        }

        .reset-btn {
            padding: 12px 24px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: var(--white);
            border: none;
            border-radius: 10px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 600;
            transition: all 0.3s ease;
            margin-top: 15px;
            box-shadow: 0 4px 12px rgba(30, 144, 255, 0.3);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .reset-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(30, 144, 255, 0.4);
            background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
        }

        .food-item.darken-0 {
            filter: brightness(1) saturate(1.2) contrast(1.1);
            background-color: inherit;
        }

        .food-item.darken-3 {
            filter: brightness(0.9) saturate(1.0) contrast(1.0);
            background-color: rgba(0, 0, 0, 0.1);
        }

        .food-item.darken-5 {
            filter: brightness(0.75) saturate(0.8) contrast(0.9);
            background-color: rgba(0, 0, 0, 0.2);
        }

        .food-item.darken-7 {
            filter: brightness(0.65) saturate(0.7) contrast(0.85);
            background-color: rgba(0, 0, 0, 0.25);
        }

        .food-item.darken-10 {
            filter: brightness(0.5) saturate(0.6) contrast(0.8);
            background-color: rgba(0, 0, 0, 0.3);
        }

        .food-item.darken-15 {
            filter: brightness(0.4) saturate(0.5) contrast(0.75);
            background-color: rgba(0, 0, 0, 0.35);
        }

        .food-item.darken-20 {
            filter: brightness(0.3) saturate(0.4) contrast(0.7);
            background-color: rgba(0, 0, 0, 0.4);
        }

        .mold {
            position: absolute;
            border-radius: 50%;
            background: rgba(100, 100, 100, 0.7);
            opacity: 0;
            transition: opacity 0.5s ease;
            z-index: 3;
        }

        .mold-0 { width: 10px; height: 10px; top: 20%; left: 30%; }
        .mold-1 { width: 15px; height: 15px; top: 60%; left: 70%; }
        .mold-2 { width: 8px; height: 8px; top: 40%; left: 50%; }
        .mold-3 { width: 12px; height: 12px; top: 70%; left: 20%; }
        .mold-4 { width: 18px; height: 18px; top: 30%; left: 80%; }

        .show-mold .mold {
            opacity: 1;
        }

        .loading .food-display {
            opacity: 0.5;
            transition: opacity 0.3s ease;
        }

        @media (max-width: 1200px) {
            .selection-area {
                grid-template-columns: 1fr;
            }

            .simulation-area {
                grid-template-columns: 1fr;
                gap: 20px;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 20px;
            }

            h1 {
                font-size: 2rem;
            }

            .food-display {
                width: 280px;
                height: 280px;
            }

            .option {
                min-width: 90px;
                padding: 12px;
            }

            .option i {
                font-size: 1.5rem;
            }
        }

        @media (max-width: 480px) {
            .container {
                padding: 15px;
            }

            h1 {
                font-size: 1.8rem;
            }

            .food-display {
                width: 240px;
                height: 240px;
            }

            .option {
                padding: 10px;
            }

            .option i {
                font-size: 1.3rem;
            }
        }

/* === BACK BUTTON === */
.back-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
    background: linear-gradient(135deg, #b84bff, #ffffff);
border: none;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.3s;
  z-index: 9999;
}

.back-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.back-btn:active {
  transform: scale(0.95);
}

.back-btn svg {
  width: 28px;
  height: 28px;
  fill: #0D1117;
}
