* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent double-tap zoom on iOS Safari - Worldle style */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Additional zoom prevention for iOS Safari */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Additional iOS Safari zoom prevention */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    margin-top: 40px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}

h1:hover {
    color: #667eea;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1em;
    line-height: 1.5;
}

.game-description {
    text-align: center;
    color: #777;
    margin-bottom: 40px;
    font-size: 0.95em;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.game-setup {
    margin-bottom: 30px;
}

.time-range-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.time-range-btn {
    padding: 12px 24px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.time-range-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.time-range-btn.selected {
    background: #667eea;
    color: white;
}

.start-btn {
    display: block;
    width: 200px;
    margin: 20px auto;
    padding: 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.game-description-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.description-content {
    max-width: 700px;
    margin: 0 auto;
}

.description-item {
    margin-bottom: 30px;
    text-align: left;
}

.description-item h3 {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 12px;
    font-weight: 600;
}

.description-item p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1em;
}

.feature-list {
    margin: 15px 0;
}

.feature {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.mode-description {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #555;
}

.modes {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
}

.mode-badge.normal {
    background: #e8f5e8;
    color: #2d5a2d;
}

.mode-badge.hard {
    background: #fff3cd;
    color: #856404;
}

.mode-badge.extreme {
    background: #f8d7da;
    color: #721c24;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .game-description-section {
        margin-top: 30px;
        padding-top: 20px;
    }

    .description-item h3 {
        font-size: 1.2em;
    }

    .description-item p {
        font-size: 0.95em;
    }

    .feature {
        font-size: 0.95em;
    }

    .modes {
        flex-direction: column;
        gap: 6px;
    }

    .mode-badge {
        font-size: 0.85em;
        padding: 5px 10px;
    }
}

.game-area {
    display: none;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.guess-input-area {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.guess-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    transition: border-color 0.3s ease;
}

.guess-input:focus {
    outline: none;
    border-color: #667eea;
}

.guess-btn {
    flex: 0 0 auto;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.guess-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.guess-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.next-hint-btn {
    flex: 0 0 50px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-hint-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.next-hint-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.previous-guesses {
    margin-bottom: 30px;
}

.previous-guesses h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.guess-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guess-item {
    padding: 8px 16px;
    background: #ffebee;
    color: #c62828;
    border-radius: 20px;
    font-weight: 500;
}

.guess-item.skipped {
    background: #f5f5f5;
    color: #666;
    font-style: italic;
}

.hints-section {
    margin-bottom: 30px;
}

.hints-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.hints-list {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.hint-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: #555;
}

.hint-item:last-child {
    border-bottom: none;
}

.photo-section {
    margin-bottom: 30px;
}

.photo-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.person-photo {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 200px;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #888;
    text-align: center;
}

.photo-placeholder-icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.photo-placeholder-text {
    font-size: 16px;
    font-weight: 500;
    color: #666;
}

.extract-section {
    margin-bottom: 30px;
}

.extract-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.extract-content {
    background: #e8f4f8;
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    font-style: italic;
    line-height: 1.6;
    color: #444;
}

.game-result {
    text-align: center;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.game-result.win {
    background: #e8f5e8;
    color: #2e7d32;
}

.game-result.lose {
    background: #ffebee;
    color: #c62828;
}

.result-title {
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 20px;
}

.result-answer {
    font-size: 1.3em;
    margin-bottom: 25px;
    line-height: 1.4;
}

.result-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wikipedia-link {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wikipedia-link:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.share-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.share-icon {
    font-size: 16px;
}

.share-btn.copied {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
}

.share-tooltip {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.share-tooltip.show {
    opacity: 1;
}

.share-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
}

.play-again-btn {
    display: inline-block;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-again-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.result-stats {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 5px solid #667eea;
}

.stats-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.see-all-stats-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.see-all-stats-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

.stats-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.stat-item-small {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-value-small {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.stat-label-small {
    font-size: 0.8em;
    color: #666;
    margin-top: 3px;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.back-home-btn {
    color: #667eea;
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
}

.back-home-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.mode-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stats-link {
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #667eea;
    transition: all 0.3s ease;
}

.stats-link:hover {
    background: #667eea;
    color: white;
}

.mode-toggles {
    display: flex;
    gap: 8px;
    background: #e0e0e0;
    border-radius: 25px;
    padding: 4px;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.mode-toggle.active {
    background: #667eea;
    color: white;
}

.mode-toggle:hover:not(.active) {
    background: #d0d0d0;
}

.flame {
    font-size: 14px;
}

.mode-text {
    font-size: 14px;
}

.help-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
}

.help-tooltip {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    width: 200px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.help-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.help-icon:hover .help-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile tooltip visibility - instant appearance when tapped */
.help-tooltip.show {
    opacity: 1;
    visibility: visible;
    transition: none; /* Remove transition for instant appearance on mobile */
}

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

.jiggle {
    animation: jiggle 0.6s ease-in-out;
}

.duplicate-guess {
    background: #ffebee !important;
    color: #c62828 !important;
    border: 1px solid #ef5350 !important;
    transform: scale(1.05);
}

.progress-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.progress-title {
    text-align: center;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.progress-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e0e0e0;
    z-index: 1;
    border-radius: 3px;
}

.progress-line-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-stage {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.progress-stage.completed .progress-label {
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.progress-stage.current .progress-label {
    color: #667eea;
    font-weight: 600;
    background: #fff;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* Error dialog styles */
.error-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.error-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.error-content h3 {
    margin: 0 0 15px 0;
    color: #d32f2f;
    font-size: 1.2em;
}

.error-content p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.error-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.error-btn:hover {
    background: #5a67d8;
}

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

    h1 {
        font-size: 2em;
    }

    .game-description {
        font-size: 0.9em;
        padding: 0 10px;
        margin-bottom: 30px;
    }

    .time-range-selector {
        flex-direction: column;
        align-items: center;
    }

    .time-range-btn {
        width: 200px;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .progress-label {
        font-size: 10px;
        max-width: 60px;
        padding: 3px 6px;
    }

    .progress-container {
        padding: 15px;
    }

    .progress-title {
        font-size: 1em;
        margin-bottom: 15px;
    }

    .stats-grid-small {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-value-small {
        font-size: 1.2em;
    }

    .result-stats {
        padding: 15px;
        margin: 15px 0;
    }

    .see-all-stats-link {
        font-size: 0.8em;
    }

    .person-photo {
        max-width: 225px;
        max-height: 225px;
    }

    .photo-container {
        padding: 15px;
    }

    .mode-section {
        flex-direction: column;
        gap: 15px;
        padding: 20px 15px;
    }

    .mode-toggles {
        order: -1;
    }

    .stats-link {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .result-links {
        flex-direction: column;
        gap: 10px;
    }

    .share-btn, .wikipedia-link, .play-again-btn {
        width: 100%;
        justify-content: center;
    }

    .result-actions {
        flex-direction: column;
        gap: 10px;
    }

    .guess-input-area {
        flex-direction: column;
        gap: 10px;
    }

    .guess-input {
        margin-bottom: 0;
    }

    .guess-btn {
        width: 100%;
        padding: 15px;
    }

    .next-hint-btn {
        flex: 0 0 auto;
        width: 25%;
        height: 50px;
        align-self: center;
    }
} 