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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    min-height: 100vh;
    color: #fff;
}

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

.title-link {
    text-decoration: none;
    display: block;
}

.title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #fff;
    transition: opacity 0.2s;
}

.title-link:hover .title {
    opacity: 0.8;
}

.subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.screen {
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none !important;
}

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

/* Start Screen */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.preset-btn {
    padding: 14px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid #333;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.preset-btn:hover {
    border-color: #888;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.preset-btn:active {
    transform: scale(0.98);
}

.divider {
    text-align: center;
    color: #666;
    margin: 25px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #333;
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.custom-category {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.custom-category input {
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
}

.custom-category input:focus {
    outline: none;
    border-color: #888;
}

.custom-category input::placeholder {
    color: #666;
}

.btn {
    display: block;
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: linear-gradient(90deg, #555, #333);
    color: #fff;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 2px solid #444;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.1);
}

.result-buttons {
    display: flex;
    gap: 10px;
}

.result-buttons .btn {
    flex: 1;
}

.btn:active {
    transform: translateY(0);
}

/* Game Screen */
.round-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
}

.question {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 25px;
}

.question strong {
    color: #fff;
    font-weight: 700;
}

.question-hint {
    font-size: 0.9rem;
    color: #888;
}

.images-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.image-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.image-card img {
    max-width: 100%;
    max-height: 350px;
    width: auto;
    height: auto;
    display: block;
}

.image-card img.loading {
    opacity: 0;
}

.image-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.image-card.correct {
    border-color: #2ecc71;
}

.image-card.incorrect {
    border-color: #e74c3c;
}

.image-card.disabled {
    pointer-events: none;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #333;
    border-top-color: #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.image-card img.loading ~ .loading-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* History of previous rounds */
.history {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-round {
    padding-top: 15px;
    border-top: 1px solid #333;
}

.history-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

a.history-card {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: transform 0.2s;
    background: #1a1a1a;
    text-decoration: none;
    color: inherit;
}

a.history-card:hover {
    transform: scale(1.02);
}

.history-card img {
    max-width: 100%;
    max-height: 350px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}

a.history-card.chosen.correct {
    border-color: #2ecc71;
}

a.history-card.chosen.wrong {
    border-color: #e74c3c;
}

/* Result card at end of game */
.result-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
}

.result-card h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #fff;
}

.result-card .final-score {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.result-card .result-message {
    color: #888;
    margin-bottom: 20px;
    font-size: 1rem;
}

.result-card .result-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.result-card .btn {
    flex: 1;
    max-width: 150px;
}

.history-meta {
    background: rgba(0,0,0,0.75);
    padding: 6px 8px;
    font-size: 0.7rem;
    line-height: 1.3;
}

.history-meta .meta-label {
    font-weight: 700;
    font-size: 0.75rem;
}

.history-meta .meta-title {
    opacity: 0.7;
    font-size: 0.65rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#game-screen {
    position: relative;
}


/* Loading Screen */
#loading-screen {
    text-align: center;
    padding: 60px 20px;
}

.loading-text {
    color: #888;
    margin-bottom: 20px;
}

.progress-container {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #888;
    width: 0%;
    transition: width 0.2s ease;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 300px;
    margin: 0 auto;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    transition: background 0.2s ease;
}

.progress-dot.found {
    background: #2ecc71;
}


/* Responsive */
@media (max-width: 600px) {
    .title {
        font-size: 2rem;
    }

    .images-container {
        grid-template-columns: 1fr;
    }

    .question {
        font-size: 1.1rem;
    }

    .divider::before,
    .divider::after {
        width: 25%;
    }
}

/* Curated images, accessible choices and readable attribution. */
[hidden]{display:none!important}
a{color:#b9d8f0}button.image-card{padding:0;font:inherit;color:inherit;width:100%}button.image-card:disabled{cursor:default}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid #e3be54;outline-offset:3px}.image-credit{font-size:12px;line-height:1.5;padding:12px;overflow-wrap:anywhere;color:#ccc}.image-credit strong{display:block;color:#fff}.image-credit p{margin:5px 0}.site-footer{border-top:1px solid #555;margin-top:28px;padding-top:18px;font-size:13px;line-height:1.6;color:#bbb}.text-button{font:inherit;border:0;background:none;color:#b9d8f0;text-decoration:underline;cursor:pointer;padding:12px 0}.custom-category p,.category-notes{font-size:14px;line-height:1.6;color:#bbb}.custom-category label{font-size:14px;color:#ddd}.category-notes p{margin-top:10px}#status{color:#ffcf9b;line-height:1.5;margin:12px 0}#round-feedback{font-size:18px;margin:16px 0}#credit-details{margin:18px 0;line-height:1.6}#next-round{margin:15px 0}.history-card{border:3px solid transparent;background:#1a1a1a;border-radius:8px;overflow:hidden}.history-card.chosen.correct{border-color:#2ecc71}.history-card.chosen.wrong{border-color:#e74c3c}.history-round h3{font-size:15px;margin-bottom:10px}#all-credits h2{margin-top:28px}#all-credits .image-credit{border-bottom:1px solid #444}#loading-count{text-align:center;color:#ccc;margin:15px}#share-status{margin:12px 0;overflow-wrap:anywhere}@media(max-width:480px){.container{padding:16px}.title{font-size:2rem}.images-container,.history-images{gap:10px}.image-card{min-height:130px}.image-credit{padding:8px;font-size:12px}.result-buttons{flex-direction:column}.divider:before,.divider:after{width:15%}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
