        body {
            margin: 0;
            padding: 0;
            min-height: 100vh;
            background: linear-gradient(135deg, #dc143c 0%, #8b0000 50%, #b22222 100%);
            font-family: 'Arial', sans-serif;
            overflow-x: hidden;
            overflow-y: auto;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container {
            text-align: center;
            position: relative;
            width: 100%;
            max-width: 500px;
            padding: 20px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            min-height: 100vh;
            gap: 30px;
        }

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

        @media (max-height: 600px) {
            .container {
                gap: 15px;
                padding: 10px;
            }
        }

        .title {
            color: #ffd700;
            font-size: 2.5em;
            margin: 0;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.6), 0 0 8px rgba(255, 215, 0, 0.25);
            opacity: 0;
            animation: fadeIn 1s ease-in forwards;
            font-weight: 400;
            letter-spacing: 1.5px;
            flex-shrink: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.2;
        }

        @media (max-width: 768px) {
            .title {
                font-size: 2em;
                padding-left: 50px;
                padding-right: 50px;
            }
        }

        @media (max-height: 600px) {
            .title {
                font-size: 1.8em;
            }
        }

        .cookie-container {
            position: relative;
            cursor: pointer;
            transition: transform 0.3s ease;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            min-height: 300px;
            max-width: 400px;
            outline: none;
            flex-shrink: 0;
        }

        .cookie-container:hover {
            transform: scale(1.05);
            filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
        }

        .cookie-container:focus {
            transform: scale(1.05);
            filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6));
        }

        .cookie-container:focus .cookie {
            box-shadow: 0 8px 20px rgba(0,0,0,0.4), inset 0 2px 10px rgba(255,255,255,0.3), 0 0 0 3px rgba(255, 215, 0, 0.8);
        }

        .cookie {
            width: 180px;
            height: 180px;
            background: linear-gradient(45deg, #ffd700 0%, #ffed4e 50%, #ffc107 100%);
            border: 4px solid #b8860b;
            border-radius: 50%;
            position: relative;
            box-shadow: 0 8px 20px rgba(0,0,0,0.4), inset 0 2px 10px rgba(255,255,255,0.3);
            transition: opacity 0.5s ease;
            opacity: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .cookie.initial-load {
            animation: slideIn 1s ease-in-out 0.5s forwards;
        }

        .cookie.visible {
            opacity: 1;
        }

        @media (max-width: 768px) {
            .cookie {
                width: 150px;
                height: 150px;
            }

            .cookie::before {
                font-size: 75px;
            }
        }

        @media (max-height: 600px) {
            .cookie {
                width: 130px;
                height: 130px;
            }

            .cookie::before {
                font-size: 65px;
            }
        }

        .cookie::before {
            content: '🥠';
            font-size: 90px;
            position: absolute;
            filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
        }

        .fortune-slip {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0);
            background: linear-gradient(145deg, #fffef7 0%, #faf8f1 100%);
            padding: 12px;
            border-radius: 10px;
            border: 2px solid #ffd700;
            box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px rgba(255, 215, 0, 0.2);
            width: 90%;
            max-width: 350px;
            min-width: 240px;
            opacity: 0;
            transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            z-index: 10;
            box-sizing: border-box;
            pointer-events: none;
        }

        .fortune-slip blockquote {
            margin: 0;
            padding: 0;
        }

        .fortune-text {
            color: #8b0000;
            font-size: 1em;
            line-height: 1.4;
            font-style: italic;
            margin-bottom: 5px;
            font-weight: 500;
            word-wrap: break-word;
            hyphens: none;
        }

        .lucky-numbers {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #ffd700;
        }

        .lucky-numbers-label {
            color: #8b0000;
            font-size: 0.9em;
            font-weight: bold;
            margin: 0 0 6px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .lucky-numbers-text {
            color: #dc143c;
            font-size: 1.1em;
            font-weight: bold;
            margin: 0;
            letter-spacing: 2px;
        }

        /* Base styles for fortune slip buttons */
        .fortune-slip-btn {
            position: absolute;
            top: -12px;
            background: #8b0000;
            border: 2px solid #ffd700;
            color: #fffef7;
            line-height: 1;
            cursor: pointer;
            padding: 0;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s ease;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        }

        .fortune-slip-btn:hover {
            background: #dc143c;
            transform: scale(1.1);
        }

        .fortune-slip-btn:focus {
            background: #dc143c;
            outline: 2px solid #ffd700;
            outline-offset: 2px;
        }

        .fortune-slip-btn svg {
            display: block;
            width: 18px;
            height: 18px;
        }

        .close-btn {
            right: -12px;
            opacity: 1;
        }

        .copy-btn {
            right: 24px;
        }

        .copy-btn.copied {
            background: #228b22;
            border-color: #90ee90;
        }

        /* Base styles for history action buttons */
        .history-btn {
            background: rgba(139, 0, 0, 0.5);
            border: 1px solid rgba(255, 215, 0, 0.3);
            color: #ffd700;
            cursor: pointer;
            padding: 6px 10px;
            border-radius: 4px;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 32px;
        }

        .history-btn svg {
            display: block;
            width: 16px;
            height: 16px;
        }

        .history-btn:hover {
            background: rgba(139, 0, 0, 0.7);
            border-color: rgba(255, 215, 0, 0.5);
            transform: translateY(-1px);
        }

        .history-btn:focus {
            outline: 2px solid #ffd700;
            outline-offset: 2px;
            background: rgba(139, 0, 0, 0.7);
        }

        .history-copy-btn.copied {
            background: rgba(34, 139, 34, 0.5);
            border-color: rgba(144, 238, 144, 0.5);
            color: #90ee90;
        }

        .history-delete-btn:hover {
            color: #ff6b6b;
        }

        .history-favorite-btn.favorited {
            color: #ffd700;
            background: rgba(255, 215, 0, 0.15);
            border-color: rgba(255, 215, 0, 0.5);
        }

        .history-favorite-btn.favorited:hover {
            background: rgba(255, 215, 0, 0.25);
        }

        .history-item.deleting {
            animation: slideOutRight 0.3s ease forwards;
            opacity: 0;
        }

        @keyframes slideOutRight {
            from {
                transform: translateX(0);
                opacity: 1;
            }
            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        /* Confirmation Dialog Styles */
        .confirmation-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(3px);
            opacity: 0;
            animation: fadeIn 0.2s ease forwards;
        }

        .confirmation-dialog {
            background: linear-gradient(135deg, rgba(139, 0, 0, 0.98) 0%, rgba(178, 34, 34, 0.98) 100%);
            border: 2px solid rgba(255, 215, 0, 0.5);
            border-radius: 15px;
            padding: 25px;
            max-width: 400px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            transform: scale(0.9);
            animation: popIn 0.3s ease forwards;
        }

        @keyframes popIn {
            to {
                transform: scale(1);
            }
        }

        .confirmation-title {
            color: #ffd700;
            font-size: 1.3em;
            margin: 0 0 15px 0;
            font-weight: 300;
            letter-spacing: 1px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        }

        .confirmation-message {
            color: #fffef7;
            font-size: 1em;
            line-height: 1.5;
            margin-bottom: 15px;
        }

        .confirmation-fortune-preview {
            color: #ffd700;
            font-size: 0.95em;
            font-style: italic;
            line-height: 1.4;
            margin-bottom: 20px;
            padding: 12px;
            background: rgba(0, 0, 0, 0.2);
            border-left: 3px solid rgba(255, 215, 0, 0.5);
            border-radius: 4px;
        }

        .confirmation-buttons {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .confirmation-btn {
            padding: 10px 20px;
            border-radius: 8px;
            border: 2px solid;
            cursor: pointer;
            font-size: 1em;
            font-weight: 500;
            transition: all 0.2s ease;
            min-width: 80px;
        }

        .confirmation-btn-cancel {
            background: transparent;
            border-color: rgba(255, 215, 0, 0.4);
            color: #ffd700;
        }

        .confirmation-btn-cancel:hover {
            background: rgba(255, 215, 0, 0.1);
            border-color: rgba(255, 215, 0, 0.6);
            transform: translateY(-1px);
        }

        .confirmation-btn-cancel:focus {
            outline: 2px solid #ffd700;
            outline-offset: 2px;
        }

        .confirmation-btn-confirm {
            background: #dc143c;
            border-color: #dc143c;
            color: #fffef7;
        }

        .confirmation-btn-confirm:hover {
            background: #b22222;
            border-color: #b22222;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(220, 20, 60, 0.4);
        }

        .confirmation-btn-confirm:focus {
            outline: 2px solid #ffd700;
            outline-offset: 2px;
        }

        @media (max-width: 768px) {
            .fortune-slip {
                padding: 10px;
                max-width: 300px;
            }

            .fortune-text {
                font-size: 0.95em;
                line-height: 1.3;
                margin-bottom: 4px;
            }

            .fortune-signature {
                font-size: 0.8em;
            }
        }

        @media (max-height: 600px) {
            .fortune-slip {
                padding: 8px;
                max-width: 280px;
            }

            .fortune-text {
                font-size: 0.9em;
                line-height: 1.2;
                margin-bottom: 3px;
            }

            .fortune-signature {
                font-size: 0.75em;
            }
        }

        .cracked .cookie {
            animation: shake 0.5s ease-in-out;
            box-shadow: 0 8px 20px rgba(0,0,0,0.4), inset 0 2px 10px rgba(255,255,255,0.3), 0 0 20px rgba(255, 215, 0, 0.4);
            opacity: 0;
            transition: opacity 0.3s ease 0.5s;
        }

        .cracked .fortune-slip {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            pointer-events: auto;
            transition-delay: 0.8s;
        }

        .api-credit {
            position: fixed;
            bottom: 10px;
            left: 10px;
            color: rgba(255, 215, 0, 0.8);
            font-size: 0.8em;
            text-decoration: none;
            background: rgba(139, 0, 0, 0.3);
            border: 1px solid rgba(255, 215, 0, 0.3);
            padding: 5px 10px;
            border-radius: 15px;
            backdrop-filter: blur(5px);
            transition: all 0.3s ease;
        }

        .api-credit:hover {
            color: #ffd700;
            background: rgba(139, 0, 0, 0.5);
            border-color: rgba(255, 215, 0, 0.5);
            text-decoration: none;
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
        }

        /* History Panel Styles */
        .history-toggle {
            position: fixed;
            top: 20px;
            right: 20px;
            background: rgba(139, 0, 0, 0.3);
            border: 2px solid rgba(255, 215, 0, 0.4);
            color: #ffd700;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
            z-index: 999;
        }

        .history-toggle svg {
            display: block;
            width: 24px;
            height: 24px;
        }

        .history-toggle:hover {
            background: rgba(139, 0, 0, 0.5);
            border-color: rgba(255, 215, 0, 0.6);
            transform: scale(1.05);
            box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
        }

        .history-toggle:focus {
            outline: 2px solid #ffd700;
            outline-offset: 2px;
            background: rgba(139, 0, 0, 0.5);
        }

        .history-panel {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background: linear-gradient(135deg, rgba(139, 0, 0, 0.95) 0%, rgba(178, 34, 34, 0.95) 100%);
            backdrop-filter: blur(10px);
            box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
            transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            border-left: 2px solid rgba(255, 215, 0, 0.3);
        }

        .history-panel.open {
            right: 0;
        }

        .history-header {
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .history-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .history-search-container {
            display: flex;
            align-items: center;
            position: relative;
        }

        .history-search-input {
            width: 100%;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 215, 0, 0.2);
            color: #fffef7;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 0.9em;
            transition: all 0.2s ease;
            box-sizing: border-box;
        }

        .history-search-input::placeholder {
            color: rgba(255, 215, 0, 0.4);
        }

        .history-search-input:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 215, 0, 0.4);
            box-shadow: 0 0 8px rgba(255, 215, 0, 0.15);
        }

        .history-title {
            color: #ffd700;
            font-size: 1.5em;
            margin: 0;
            font-weight: 300;
            letter-spacing: 2px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
        }

        .history-filter {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .filter-toggle {
            background: rgba(139, 0, 0, 0.5);
            border: 1px solid rgba(255, 215, 0, 0.3);
            color: rgba(255, 215, 0, 0.7);
            cursor: pointer;
            padding: 6px 12px;
            border-radius: 4px;
            transition: all 0.2s ease;
            font-size: 0.85em;
            letter-spacing: 0.5px;
        }

        .filter-toggle:hover {
            background: rgba(139, 0, 0, 0.7);
            border-color: rgba(255, 215, 0, 0.5);
            color: #ffd700;
        }

        .filter-toggle:focus {
            outline: 2px solid #ffd700;
            outline-offset: 2px;
        }

        .filter-toggle.active {
            background: rgba(255, 215, 0, 0.15);
            border-color: rgba(255, 215, 0, 0.6);
            color: #ffd700;
        }

        .fortune-counter {
            font-size: 0.65em;
            color: rgba(255, 215, 0, 0.7);
            font-weight: 400;
            letter-spacing: 1px;
            margin-left: 8px;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: inline-block;
        }

        .fortune-counter.counter-bump {
            transform: scale(1.15);
            color: #ffd700;
        }

        .history-close {
            background: transparent;
            border: none;
            color: #ffd700;
            cursor: pointer;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s ease;
        }

        .history-close svg {
            display: block;
            width: 24px;
            height: 24px;
        }

        .history-close:hover {
            background: rgba(255, 215, 0, 0.1);
            transform: scale(1.1);
        }

        .history-close:focus {
            outline: 2px solid #ffd700;
            outline-offset: 2px;
            background: rgba(255, 215, 0, 0.15);
        }

        .history-list {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .history-item {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 215, 0, 0.2);
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 15px;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .history-item.favorited {
            background: rgba(255, 215, 0, 0.08);
            border-color: rgba(255, 215, 0, 0.5);
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
        }

        .history-item:hover {
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 215, 0, 0.4);
            transform: translateX(-5px);
        }

        .history-item.favorited:hover {
            background: rgba(255, 215, 0, 0.12);
            border-color: rgba(255, 215, 0, 0.6);
        }

        .history-fortune-text {
            color: #fffef7;
            font-size: 0.95em;
            line-height: 1.4;
            font-style: italic;
            word-wrap: break-word;
        }

        .search-highlight {
            background-color: rgba(255, 215, 0, 0.35);
            padding: 1px 2px;
            border-radius: 2px;
            color: #ffd700;
            font-weight: 600;
        }

        .history-lucky-numbers {
            color: rgba(255, 215, 0, 0.8);
            font-size: 0.85em;
            margin-top: 6px;
            font-weight: 500;
            letter-spacing: 1px;
        }

        .history-item-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .history-item-actions {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .history-timestamp {
            color: rgba(255, 215, 0, 0.7);
            font-size: 0.75em;
            flex-shrink: 0;
        }

        .history-empty {
            text-align: center;
            color: rgba(255, 215, 0, 0.6);
            padding: 40px 20px;
            font-style: italic;
        }

        @media (max-width: 768px) {
            .history-panel {
                width: 100%;
                right: -100%;
            }

            .history-toggle {
                top: 10px;
                right: 10px;
                width: 45px;
                height: 45px;
            }
        }

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

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

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
            20%, 40%, 60%, 80% { transform: translateX(5px); }
        }

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

        @media (prefers-reduced-motion: reduce) {
            * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }

            .cookie-container:hover,
            .cookie-container:focus {
                transform: scale(1.02);
            }

            @keyframes fall {
                to {
                    transform: translateY(100vh);
                    opacity: 0;
                }
            }
        }

        /* Screen reader only content */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .sr-only.focusable:focus {
            position: static;
            width: auto;
            height: auto;
            padding: 10px;
            margin: 10px;
            overflow: visible;
            clip: auto;
            white-space: normal;
            background: rgba(255, 215, 0, 0.95);
            color: #8b0000;
            border: 2px solid #ffd700;
            border-radius: 5px;
            text-decoration: none;
            font-weight: bold;
            z-index: 9999;
        }

