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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #f5f5dc;
    background:
        radial-gradient(circle at 20% 80%, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(184, 134, 11, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #1a0f08 0%, #2c1810 50%, #1a0f08 100%);
    min-height: 100vh;
    position: relative;
    /* Ensure proper mobile scaling */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(218, 165, 32, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 75% 75%, rgba(139, 69, 19, 0.02) 0%, transparent 25%);
    pointer-events: none;
}

/* Global status overlay styles removed - now using inline card placeholders */

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes psychedelic {
    0% {
        background-position: 0% 50%;
        transform: scale(1) rotate(0deg);
        filter: hue-rotate(0deg);
    }
    25% {
        background-position: 100% 50%;
        transform: scale(1.1) rotate(90deg);
        filter: hue-rotate(90deg);
    }
    50% {
        background-position: 100% 100%;
        transform: scale(1.05) rotate(180deg);
        filter: hue-rotate(180deg);
    }
    75% {
        background-position: 0% 100%;
        transform: scale(1.15) rotate(270deg);
        filter: hue-rotate(270deg);
    }
    100% {
        background-position: 0% 50%;
        transform: scale(1) rotate(360deg);
        filter: hue-rotate(360deg);
    }
}

@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

/* Card states for placeholder cards */
.card-waiting .card-image-placeholder {
    animation: pulse 2s ease-in-out infinite;
}

.card-waiting .frog-emoji {
    opacity: 0.7;
}

.card-processing .card-image-placeholder {
    animation: psychedelic 1.5s ease-in-out infinite;
    border-color: #ffd700 !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.card-processing .frog-emoji {
    color: #ffd700 !important;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.card-completed .card-image-placeholder {
    animation: flip 0.8s ease-in-out;
    transform: rotateY(180deg);
}

.card-completed {
    animation: cardCompleteGlow 0.5s ease-out;
}

@keyframes cardCompleteGlow {
    0% {
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }
    50% {
        box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
    }
    100% {
        box-shadow: 0 8px 25px rgba(76, 175, 80, 0.2);
    }
}

/* Status progress text style removed - now using inline processing header */

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: #daa520;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #daa520, transparent);
    opacity: 0.6;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(218, 165, 32, 0.5), 2px 2px 4px rgba(0,0,0,0.8);
    font-weight: bold;
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
    color: #f5f5dc;
    text-shadow: 0 0 10px rgba(245, 245, 220, 0.3);
}

.main-section {
    background:
        linear-gradient(145deg, rgba(42, 24, 16, 0.95) 0%, rgba(26, 15, 8, 0.98) 100%),
        radial-gradient(circle at 30% 20%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(218, 165, 32, 0.05) 0%, transparent 50%);
    padding: 30px;
    border-radius: 15px;
    box-shadow:
        0 10px 30px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(218, 165, 32, 0.1),
        inset 0 -1px 0 rgba(139, 69, 19, 0.1);
    margin-bottom: 40px;
    text-align: center;
    border: 1px solid rgba(218, 165, 32, 0.2);
    position: relative;
    overflow: hidden;
}

.main-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(218, 165, 32, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(139, 69, 19, 0.02) 0%, transparent 20%);
    pointer-events: none;
}

.main-section h2 {
    color: #daa520;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
    position: relative;
    z-index: 1;
}

.main-section p {
    color: #f5f5dc;
    margin-bottom: 30px;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(245, 245, 220, 0.3);
    position: relative;
    z-index: 1;
}

.upload-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(218, 165, 32, 0.3);
    position: relative;
    z-index: 1;
}

.upload-toggle {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8), rgba(101, 67, 33, 0.8));
    border: 2px solid #daa520;
    color: #daa520;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.upload-toggle:hover {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.9), rgba(139, 69, 19, 0.9));
    border-color: #ffd700;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.dropbox-controls {
    margin-bottom: 20px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.upload-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.upload-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.upload-area {
    margin-bottom: 20px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-content {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.upload-content:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-content span {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #666;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.9), rgba(101, 67, 33, 0.9));
    color: #daa520;
    border: 2px solid #daa520;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(160, 82, 45, 0.95), rgba(139, 69, 19, 0.95));
    border-color: #ffd700;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.2);
}

.cards-section {
    background:
        linear-gradient(145deg, rgba(42, 24, 16, 0.95) 0%, rgba(26, 15, 8, 0.98) 100%),
        radial-gradient(circle at 40% 30%, rgba(139, 69, 19, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 60% 70%, rgba(218, 165, 32, 0.04) 0%, transparent 40%);
    padding: 30px;
    border-radius: 15px;
    box-shadow:
        0 10px 30px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(218, 165, 32, 0.1),
        inset 0 -1px 0 rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
    position: relative;
    overflow: hidden;
}

.cards-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(218, 165, 32, 0.02) 0%, transparent 25%),
        radial-gradient(circle at 70% 60%, rgba(139, 69, 19, 0.02) 0%, transparent 25%);
    pointer-events: none;
}

.cards-section h2 {
    margin-bottom: 20px;
    color: #daa520;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
    position: relative;
    z-index: 1;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 25px;
    justify-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.trading-card {
    background:
        linear-gradient(145deg, rgba(47, 31, 23, 0.98) 0%, rgba(35, 23, 18, 0.99) 100%),
        radial-gradient(circle at 25% 25%, rgba(139, 69, 19, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 75% 75%, rgba(218, 165, 32, 0.08) 0%, transparent 40%);
    border-radius: 15px;
    padding: 20px;
    box-shadow:
        0 8px 25px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(218, 165, 32, 0.15),
        inset 0 -1px 0 rgba(139, 69, 19, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid rgba(218, 165, 32, 0.3);
    width: 360px;
    min-height: 640px;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.trading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(218, 165, 32, 0.04) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(139, 69, 19, 0.03) 0%, transparent 25%);
    pointer-events: none;
}

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

.card-header {
    text-align: left;
    margin-bottom: 10px;
    position: relative;
    min-height: 60px;
}

.card-rarity {
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.download-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 10;
}

.download-btn:hover {
    background: white;
    transform: scale(1.1);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.card-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f5f5dc;
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 0 0 8px rgba(245, 245, 220, 0.3);
    position: relative;
    z-index: 1;
}

.card-content-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.card-image {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #fff;
    flex-shrink: 0;
    background: rgba(0,0,0,0.1);
    transition: object-fit 0.3s ease;
}

/* For very wide or tall images, try to show more content */
.card-image.wide-image {
    object-fit: contain;
}

.card-image.tall-image {
    object-fit: contain;
}

.card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1;
}

.stat {
    text-align: center;
    padding: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.7rem;
    color: #daa520;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f5f5dc;
    text-shadow: 0 0 5px rgba(245, 245, 220, 0.2);
}

.card-abilities {
    margin-bottom: 10px;
}

.section-title {
    font-size: 0.7rem;
    font-weight: bold;
    color: #daa520;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-align: center;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
    position: relative;
    z-index: 1;
}

.ability {
    background: rgba(139, 69, 19, 0.2);
    border-radius: 5px;
    padding: 4px;
    margin-bottom: 3px;
    font-size: 0.65rem;
    border: 1px solid rgba(218, 165, 32, 0.1);
}

.ability-name {
    font-weight: bold;
    color: #daa520;
    margin-bottom: 2px;
    text-shadow: 0 0 3px rgba(218, 165, 32, 0.2);
}

.ability-description {
    color: #f5f5dc;
    font-style: italic;
    margin-bottom: 2px;
    line-height: 1.2;
    text-shadow: 0 0 2px rgba(245, 245, 220, 0.1);
}

.ability-cost {
    color: #daa520;
    font-weight: bold;
    text-align: right;
    text-shadow: 0 0 3px rgba(218, 165, 32, 0.2);
}

.no-abilities {
    font-size: 0.65rem;
    color: #daa520;
    font-style: italic;
    text-align: center;
    padding: 4px;
    text-shadow: 0 0 3px rgba(218, 165, 32, 0.2);
}

.card-scientific {
    margin-bottom: 10px;
}

.scientific-item {
    font-size: 0.6rem;
    color: #f5f5dc;
    margin-bottom: 2px;
    line-height: 1.1;
    text-shadow: 0 0 2px rgba(245, 245, 220, 0.1);
}

.scientific-label {
    font-weight: bold;
    color: #daa520;
    text-shadow: 0 0 3px rgba(218, 165, 32, 0.2);
}

.card-description {
    font-size: 0.8rem;
    color: #f5f5dc;
    font-style: italic;
    line-height: 1.3;
    margin-bottom: 10px;
    flex-grow: 1;
    text-shadow: 0 0 3px rgba(245, 245, 220, 0.1);
    position: relative;
    z-index: 1;
}

.card-volatility {
    font-size: 0.7rem;
    color: #daa520;
    font-weight: bold;
    text-align: center;
    margin-top: 2px;
    text-shadow: 0 0 3px rgba(218, 165, 32, 0.2);
}

.card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(218, 165, 32, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    position: relative;
    z-index: 1;
}

.card-number {
    font-size: 0.8rem;
    color: #daa520;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(218, 165, 32, 0.2);
}

.card-value {
    font-size: 0.7rem;
    color: #f5f5dc;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(245, 245, 220, 0.1);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Processing header styles */
.processing-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background:
        linear-gradient(145deg, rgba(42, 24, 16, 0.95) 0%, rgba(26, 15, 8, 0.98) 100%),
        radial-gradient(circle at 50% 50%, rgba(218, 165, 32, 0.05) 0%, transparent 30%);
    border-radius: 15px;
    box-shadow:
        0 5px 15px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
    position: relative;
    overflow: hidden;
}

.processing-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(218, 165, 32, 0.02) 0%, transparent 20%),
        radial-gradient(circle at 75% 75%, rgba(139, 69, 19, 0.02) 0%, transparent 20%);
    pointer-events: none;
}

.processing-message {
    font-size: 1.3rem;
    font-weight: bold;
    color: #daa520;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(218, 165, 32, 0.4);
    position: relative;
    z-index: 1;
}

.processing-progress {
    font-size: 1rem;
    color: #f5f5dc;
    text-shadow: 0 0 5px rgba(245, 245, 220, 0.2);
    position: relative;
    z-index: 1;
}

/* Placeholder card styles */
.card-placeholder {
    opacity: 0.9;
}

.card-image-placeholder {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.placeholder-content {
    text-align: center;
    z-index: 2;
}

.frog-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: bounce 2s ease-in-out infinite;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.loading-dots span {
    font-size: 2rem;
    color: rgba(255,255,255,0.8);
    animation: loadingDots 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.3s; }
.loading-dots span:nth-child(3) { animation-delay: 0.6s; }

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

@keyframes loadingDots {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.ability-placeholder {
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    padding: 4px;
    margin-bottom: 3px;
    font-size: 0.65rem;
}

.scientific-placeholder {
    font-size: 0.6rem;
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PNG Display Mode Styles */
.png-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 10px 20px;
    border-bottom: 1px solid rgba(218, 165, 32, 0.3);
    position: relative;
    z-index: 1;
}

.png-display-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f5f5dc;
    text-shadow: 0 0 8px rgba(245, 245, 220, 0.3);
    flex: 1;
}

.png-display-controls {
    display: flex;
    gap: 10px;
}

.back-to-card-btn,
.download-png-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    color: #2c1810;
}

.back-to-card-btn:hover,
.download-png-btn:hover {
    background: white;
    transform: scale(1.05);
}

.back-to-card-btn {
    background: rgba(139, 69, 19, 0.9);
    color: #daa520;
}

.back-to-card-btn:hover {
    background: rgba(160, 82, 45, 1);
}

.png-display-container {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.card-png-image {
    max-width: 100%;
    max-height: 600px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    border: 2px solid rgba(218, 165, 32, 0.3);
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 5px;
    border-radius: 25px;
    padding: 5px;
    background: rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
}

.tab-button {
    background: rgba(139, 69, 19, 0.6);
    border: 2px solid rgba(218, 165, 32, 0.3);
    color: #daa520;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
    flex: 1;
    max-width: 150px;
    /* Ensure touch targets are adequate on mobile */
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover {
    background: rgba(160, 82, 45, 0.8);
    border-color: #ffd700;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    transform: translateY(-1px);
}

.tab-button.active {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.8), rgba(184, 134, 11, 0.8));
    border-color: #daa520;
    color: #2c1810;
    text-shadow: none;
    box-shadow: 0 2px 10px rgba(218, 165, 32, 0.3);
}

.tab-content {
    position: relative;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    width: 100%;
}

.tab-panel.active {
    display: block;
}

/* Ensure tab panels are properly sized on mobile */
@media (max-width: 768px) {
    .tab-panel {
        width: 100% !important;
        padding: 0 10px;
        box-sizing: border-box;
    }
}

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

/* Greentext Controls */
.greentext-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.character-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.character-selector select {
    width: 100% !important;
    max-width: 300px;
    /* Ensure proper touch target on mobile */
    min-height: 44px;
    font-size: 16px; /* Prevent zoom on iOS */
}

.character-selector label {
    font-weight: bold;
    color: #daa520;
    text-shadow: 0 0 5px rgba(218, 165, 32, 0.3);
}

.character-selector select {
    width: 100%;
    padding: 10px;
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c1810;
    font-size: 1rem;
    cursor: pointer;
}

.character-selector select:focus {
    outline: none;
    border-color: #daa520;
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
}

.greentext-options {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #f5f5dc;
    text-shadow: 0 0 3px rgba(245, 245, 220, 0.2);
    flex-wrap: wrap;
    justify-content: center;
}

.greentext-options input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
}

/* 4chan-style Thread Styles */
.chan-thread {
    max-width: 1000px;
    margin: 0 auto;
    background: #eef2ff;
    border: 1px solid #b7c5d9;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.2;
}

.thread-header {
    background: #d6daf0;
    padding: 8px 12px;
    border-bottom: 1px solid #b7c5d9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.board-name {
    font-weight: bold;
    color: #800000;
}

.archive-link {
    color: #34345c;
    text-decoration: none;
}

.post {
    border-bottom: 1px solid #b7c5d9;
}

.op-post {
    background: #f0e0d6;
}

.post-header {
    padding: 4px 8px;
    background: #d6daf0;
    border-bottom: 1px solid #b7c5d9;
}

.post-info {
    font-size: 11px;
    color: #800000;
}

.poster-name {
    font-weight: bold;
    margin-right: 8px;
}

.post-time {
    margin-right: 8px;
}

.post-number {
    margin-right: 4px;
}

.post-link {
    color: #34345c !important;
    text-decoration: none;
    margin-right: 4px;
}

.reply-link {
    color: #34345c !important;
    text-decoration: none;
    margin-left: 8px;
}

.post-content {
    padding: 8px;
    display: flex;
    gap: 12px;
}

.post-image {
    flex-shrink: 0;
}

.post-image img {
    max-width: 150px;
    max-height: 150px;
    border: 1px solid #b7c5d9;
    background: white;
}

.image-filename {
    font-size: 10px;
    color: #34345c;
    margin-top: 2px;
    word-break: break-all;
}

.post-message {
    flex: 1;
    color: #000;
    word-wrap: break-word;
}

.greentext-subject {
    font-weight: bold;
    color: #117743;
    display: block;
    margin-bottom: 4px;
}

.greentext-line {
    color: #789922;
    font-family: 'Courier New', monospace;
    display: block;
    margin: 2px 0;
}

.thread-stats {
    padding: 8px;
    background: #f0e0d6;
    border-bottom: 1px solid #b7c5d9;
    font-size: 11px;
    color: #800000;
}

.post-form {
    background: #d6daf0;
    border-top: 1px solid #b7c5d9;
}

.form-header {
    padding: 8px 12px;
    background: #d6daf0;
    border-bottom: 1px solid #b7c5d9;
}

.form-title {
    color: #800000;
    font-weight: bold;
}

.reply-form {
    padding: 12px;
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-row label {
    width: 80px;
    font-size: 11px;
    color: #800000;
    flex-shrink: 0;
}

/* 4chan Modal Styles */
.chan-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

.modal-content {
    background: #eef2ff;
    border: 1px solid #b7c5d9;
    border-radius: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    background: #d6daf0;
    padding: 8px 12px;
    border-bottom: 1px solid #b7c5d9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: bold;
    color: #800000;
    font-size: 14px;
}

.modal-close {
    color: #34345c;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    background: #b7c5d9;
}

.modal-body {
    padding: 16px;
    text-align: center;
}

.modal-quote {
    margin-bottom: 20px;
    padding: 16px;
    background: #f0e0d6;
    border: 1px solid #b7c5d9;
}

.quote-text {
    font-size: 18px;
    font-weight: bold;
    color: #800000;
    margin-bottom: 8px;
    font-style: italic;
}


.modal-message {
    color: #000;
    line-height: 1.4;
}

.modal-message p {
    margin: 8px 0;
}

/* Matrix Animation Styles */
.matrix-animation {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #000011 0%, #000033 50%, #000011 100%);
    border-radius: 15px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.matrix-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(0, 255, 0, 0.03) 25%,
        transparent 50%,
        rgba(0, 255, 0, 0.03) 75%,
        transparent 100%);
    animation: matrixGlow 3s ease-in-out infinite;
}

@keyframes matrixGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.matrix-header {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.matrix-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
}

.matrix-subtitle {
    font-size: 1rem;
    color: #00aa00;
    font-family: 'Courier New', monospace;
    opacity: 0.8;
}

.matrix-canvas {
    background: #000;
    border: 1px solid #00ff00;
    border-radius: 5px;
    margin: 20px auto;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.2);
}

.matrix-status {
    margin-top: 20px;
    position: relative;
    z-index: 2;
}

.matrix-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.matrix-dots .dot {
    color: #00ff00;
    font-size: 1.5rem;
    animation: matrixDots 1.5s ease-in-out infinite;
}

.matrix-dots .dot:nth-child(1) { animation-delay: 0s; }
.matrix-dots .dot:nth-child(2) { animation-delay: 0.3s; }
.matrix-dots .dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes matrixDots {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.matrix-progress {
    color: #00aa00;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .modal-body {
        padding: 12px;
    }

    .quote-text {
        font-size: 16px;
    }

    .matrix-animation {
        padding: 15px;
    }

    .matrix-title {
        font-size: 1.2rem;
    }

    .matrix-subtitle {
        font-size: 0.9rem;
    }
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row textarea {
    flex: 1;
    padding: 4px 6px;
    border: 1px solid #b7c5d9;
    font-family: Arial, sans-serif;
    font-size: 13px;
    background: white;
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.post-button {
    background: #f0e0d6;
    border: 1px solid #b7c5d9;
    padding: 4px 12px;
    font-size: 11px;
    color: #800000;
    cursor: pointer;
}

.post-button:hover {
    background: #e9d5c9;
}

/* Generate Again Button */
.generate-again-btn {
    animation: generateAgainPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3) !important;
}

.generate-again-btn:hover {
    animation: none;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.4) !important;
}

@keyframes generateAgainPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
    }
    50% {
        box-shadow: 0 4px 15px rgba(218, 165, 32, 0.6);
    }
}

.clear {
    clear: both;
}

/* Mobile responsiveness for 4chan style */
@media (max-width: 768px) {
    .chan-thread {
        margin: 0 10px;
        font-size: 12px;
    }

    .post-content {
        flex-direction: column;
        gap: 8px;
    }

    .post-image img {
        max-width: 120px;
        max-height: 120px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row label {
        width: auto;
        margin-bottom: 4px;
    }

    /* Ensure greentext is visible on mobile */
    .greentext-line {
        display: block !important;
        visibility: visible !important;
        white-space: pre-wrap;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    .post-message {
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    .greentext-subject {
        font-size: 14px !important;
        font-weight: bold !important;
    }
}

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

@media (max-width: 480px) {
    /* Cards maintain consistent appearance across all devices */
}

/* Password Protection Overlay */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    animation: doorFadeIn 2s ease-in;
    overflow: hidden;
    /* Prevent mobile zoom issues */
    -webkit-overflow-scrolling: touch;
}

@keyframes doorFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.password-gate {
    text-align: center;
    color: #d4af37;
    max-width: 700px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    border: 3px solid #d4af37;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3);
    position: relative;
    overflow: hidden;
    /* Prevent mobile zoom issues */
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.door-description {
    margin-bottom: 20px;
}

.lore-text {
    font-size: 16px;
    margin: 5px 0;
    font-style: italic;
    color: #daa520;
    text-shadow: 0 0 8px rgba(218, 165, 32, 0.6);
}

.lore-text.small {
    font-size: 12px;
    opacity: 0.8;
}

.door-ascii {
    margin-bottom: 30px;
    font-size: 12px;
    line-height: 1.2;
    white-space: pre;
    color: #daa520;
    text-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
    position: relative;
}

.door-ascii pre {
    margin: 0;
    padding: 0;
    font-family: inherit;
    transition: all 0.5s ease;
}

.door-ascii.illuminated {
    animation: doorGlow 2s ease-in-out infinite alternate;
}

@keyframes doorGlow {
    0% {
        text-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
        filter: brightness(1);
    }
    100% {
        text-shadow: 0 0 20px rgba(218, 165, 32, 1), 0 0 30px rgba(218, 165, 32, 0.8);
        filter: brightness(1.2);
    }
}

@keyframes doorOpen {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
        filter: brightness(1.3) blur(1px);
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
        filter: brightness(2) blur(3px);
    }
}

.password-hint {
    margin-bottom: 20px;
}

.password-hint p {
    font-size: 14px;
    color: #daa520;
    margin: 5px 0;
    opacity: 0.9;
}

.hint-text {
    font-style: italic;
    color: #ffd700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.8) !important;
}

.password-input-container {
    margin-top: 20px;
}

#password-input {
    width: 280px;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #d4af37;
    text-align: center;
    margin-bottom: 15px;
    outline: none;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

#password-input:focus {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

#password-input::placeholder {
    color: rgba(212, 175, 55, 0.7);
}

.password-gate .btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #daa520 100%);
    color: #2c1810;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    border: 2px solid #ffd700;
    margin: 0 auto;
    display: block;
    min-width: 120px;
    transition: all 0.3s ease;
}

.password-gate .btn-primary:hover {
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.password-gate .btn-primary:active {
    transform: translateY(0);
}

.password-error {
    color: #ff6b6b;
    font-weight: bold;
    margin-top: 10px;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(255, 107, 107, 0.5);
    animation: errorShake 0.5s ease-in-out;
}

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

/* Easter Egg Styles */
.easter-egg {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #daa520;
    border-radius: 10px;
    padding: 15px;
    max-width: 200px;
    animation: easterEggAppear 0.8s ease-out;
}

@keyframes easterEggAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.easter-content h3 {
    color: #ffd700;
    margin: 0 0 10px 0;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.easter-content p {
    color: #daa520;
    margin: 5px 0;
    font-size: 12px;
    line-height: 1.4;
}

.easter-content p.small {
    font-size: 10px;
    opacity: 0.8;
    font-style: italic;
}

    /* Responsive password overlay */
@media (max-width: 768px) {
    .password-gate {
        padding: 20px;
        margin: 20px;
        max-width: 90%;
    }

    .door-ascii {
        font-size: 10px;
    }

    #password-input {
        width: 200px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .door-ascii {
        font-size: 8px;
    }

    #password-input {
        width: 180px;
        font-size: 12px;
    }

    .password-gate {
        padding: 15px;
    }

    /* Ensure no zoom issues on very small screens */
    .password-overlay {
        align-items: flex-start;
        padding-top: 20px;
    }

    .password-gate {
        margin: 10px;
        max-height: 85vh;
    }
}
