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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --success-light: #34d399;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Header Styles */
.app-header {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    font-size: 40px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.app-title {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.debug-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    box-shadow: var(--shadow-sm);
}

.debug-icon {
    font-size: 18px;
}

/* Stats Section */
.stats-section {
    margin-bottom: 32px;
}

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

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card-total::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-card-correct::before {
    background: linear-gradient(90deg, var(--success-color), var(--success-light));
}

.stat-card-accuracy::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    transition: var(--transition);
}

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

/* Puzzle Section */
.puzzle-section {
    margin-bottom: 32px;
}

.puzzle-container {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.puzzle-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), #a78bfa, var(--primary-color));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.difficulty-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #bae6fd;
    border-radius: var(--radius-md);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--shadow-sm);
}

.difficulty-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.puzzle-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    width: 100%;
}

.puzzle-image-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.puzzle-image-container {
    text-align: center;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 18px auto;
    width: 100%;
    max-width: 1140px;
}

.puzzle-image-container:has(.mirror-layout),
.puzzle-image-container:has(.squiggle-options-grid),
.puzzle-image-container:has(.shadow-plausible-grid),
.puzzle-image-container:has(.grid-container),
.puzzle-image-container:has(.bingo-grid) {
    display: block;
    flex-direction: column;
}

.puzzle-image-container.adversarial-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 360px;
}

.puzzle-image-container.adversarial-layout #puzzle-image,
.puzzle-image-container.adversarial-layout .puzzle-video {
    width: clamp(260px, 60vw, 780px);
    max-height: 70vh;
    border-radius: 8px;
    margin: 0 auto;
    object-fit: contain;
}

#puzzle-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 4px;
    display: block;
    margin: 0 auto;
}

#puzzle-image.clickable {
    cursor: pointer;
    border: 2px solid #3498db;
}

.puzzle-video {
    max-width: 100%;
    max-height: 500px;
    border-radius: 4px;
    display: block;
    outline: none;
}

.red-dot-area {
    position: relative;
    margin: 0 auto 16px auto;
    background: #fff4f4;
    border: 2px dashed #ff6b6b;
    border-radius: 12px;
    box-shadow: inset 0 0 12px rgba(255, 107, 107, 0.25);
    overflow: hidden;
}

.red-dot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffefef 0%, #ff1f1f 60%, #b40000 100%);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.2s ease;
}

.red-dot:hover {
    transform: scale(1.12);
}

.red-dot-hidden {
    opacity: 0;
    pointer-events: none;
}

.puzzle-question-section {
    text-align: center !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.puzzle-prompt {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 auto 32px auto;
    line-height: 1.6;
    padding: 20px 40px;
    text-align: center !important;
    width: 100%;
    max-width: 900px;
    display: block;
    word-wrap: break-word;
    box-sizing: border-box;
}

#puzzle-prompt {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.answer-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface);
    transition: var(--transition);
    outline: none;
    min-width: 200px;
}

.answer-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.answer-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.submit-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-button:hover::before {
    width: 300px;
    height: 300px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-icon {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.submit-button:hover .button-icon {
    transform: translateX(4px);
}

#user-answer {
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    width: 100%;
    max-width: 400px;
}

#submit-answer {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

#submit-answer:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

#submit-answer:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

.result-message {
    font-weight: 600;
    margin-top: 20px;
    min-height: 32px;
    font-size: 18px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: inline-block;
    transition: var(--transition);
}

.result-message.correct {
    color: #065f46;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 2px solid var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.result-message.incorrect {
    color: #991b1b;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 2px solid var(--error-color);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.result-message.instruction {
    color: #1e40af;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Click marker styles */
.click-marker {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(231, 76, 60, 0.7);
    border: 2px solid #e74c3c;
    transform: translate(-50%, -50%);
    pointer-events: none;
    /* Add animation */
    animation: pulse 1s infinite alternate;
    z-index: 10;
}

@keyframes pulse {
    from {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }
    to {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-wrapper {
        padding: 16px;
    }

    .app-header {
        padding: 16px 20px;
    }

    .app-title {
        font-size: 24px;
    }

    .logo-icon {
        font-size: 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 40px;
    }

    .stat-value {
        font-size: 28px;
    }

    .puzzle-container {
        padding: 24px 20px;
    }

    .puzzle-prompt {
        font-size: 24px;
        padding: 16px 20px;
    }

    .input-group {
        flex-direction: column;
        gap: 12px;
    }

    .answer-input {
        width: 100%;
    }

    .submit-button {
        width: 100%;
        justify-content: center;
    }

    .difficulty-badge {
        padding: 10px 16px;
        margin-bottom: 24px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .main-wrapper {
        padding: 12px;
    }

    .app-title {
        font-size: 20px;
    }

    .stat-value {
        font-size: 24px;
    }

    .puzzle-prompt {
        font-size: 20px;
        padding: 12px 16px;
    }

    .result-message {
        font-size: 16px;
        padding: 10px 16px;
    }
}

/* Rotation CAPTCHA styles */
.rotation-layout {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.reference-image-container,
.object-image-container {
    flex: 0 0 45%;
    text-align: center;
    position: relative;
}

.reference-image-container::before,
.object-image-container::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.reference-image-container::before {
    content: "Reference";
}

/* Shadow Plausible CAPTCHA */
.shadow-plausible-grid {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.shadow-cell {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #333;
    background-color: #111;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 3 / 2;
    cursor: pointer;
}

.shadow-cell:hover {
    transform: translateY(-2px);
    border-color: #2ecc71;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.shadow-cell img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #000;
}

.shadow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 120, 255, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.shadow-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 36px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.shadow-submit {
    width: 100%;
    display: flex;
    justify-content: center;
}

.submit-shadow {
    padding: 16px 40px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 6px 14px rgba(46, 204, 113, 0.35);
}

.submit-shadow:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
}

.submit-shadow:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 900px) {
    .shadow-plausible-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .shadow-plausible-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .submit-shadow {
        width: 100%;
    }
}

/* Spooky Grid CAPTCHA Styles */
.grid-container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background-color: #0a0a0a;
    border-radius: 8px;
}

.grid-cell {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #333;
    background-color: #111;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 1 / 1;
}

.grid-cell:hover {
    transform: scale(1.02);
    border-color: #0078ff;
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.3);
}

.grid-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 120, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.grid-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: bold;
    color: #0078ff;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.grid-submit {
    margin-top: 20px;
    text-align: center;
}

.submit-grid {
    background-color: #0078ff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(0, 120, 255, 0.3);
}

.submit-grid:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 16px rgba(0, 120, 255, 0.4);
    transform: translateY(-1px);
}

.submit-grid:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 600px) {
    .grid-container {
        max-width: 100%;
        gap: 6px;
        padding: 8px;
    }

    .grid-checkmark {
        font-size: 36px;
    }

    .submit-grid {
        width: 100%;
    }
}

/* Color Counting Grid - White Background Variant */
.grid-container.color-counting-grid {
    background-color: #ffffff;
    border: 2px solid #ddd;
    max-width: 640px;
}

.grid-container.color-counting-grid .grid-cell {
    border: 2px solid #ccc;
    background-color: #fff;
}

.grid-container.color-counting-grid .grid-cell:hover {
    border-color: #0078ff;
}

/* Hole Counting Grid - Clean display for 120x120 images with clear patterns */
.grid-container.hole-counting-grid {
    max-width: 720px;
    gap: 12px;
    padding: 16px;
    background-color: #f5f5f5;
}

.grid-container.hole-counting-grid .grid-cell {
    border: 3px solid #555;
    background-color: #fff;
    width: 160px;
    height: 160px;
}

.grid-container.hole-counting-grid .grid-cell:hover {
    border-color: #0078ff;
    transform: scale(1.03);
}

.grid-container.hole-counting-grid .grid-cell img {
    width: 160px;
    height: 160px;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* Rotation Match Grid - Clean display for 240x240 images with rotated shapes and fine textures */
.grid-container.rotation-match-grid {
    max-width: 1000px;
    gap: 12px;
    padding: 16px;
    background-color: #f5f5f5;
}

.grid-container.rotation-match-grid .grid-cell {
    border: 3px solid #555;
    background-color: #fff;
    width: 220px;
    height: 220px;
}

.grid-container.rotation-match-grid .grid-cell:hover {
    border-color: #0078ff;
    transform: scale(1.03);
}

.grid-container.rotation-match-grid .grid-cell img {
    width: 220px;
    height: 220px;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* Rhythm Grid - Display for 160x160 pulsing GIFs */
.grid-container.rhythm-grid {
    max-width: 720px;
    gap: 12px;
    padding: 16px;
    background-color: #f5f5f5;
}

.grid-container.rhythm-grid .grid-cell {
    border: 3px solid #555;
    background-color: #fff;
    width: 160px;
    height: 160px;
}

.grid-container.rhythm-grid .grid-cell:hover {
    border-color: #0078ff;
    transform: scale(1.05);
}

.grid-container.rhythm-grid .grid-cell img {
    width: 160px;
    height: 160px;
    image-rendering: auto;
}

/* Reference GIF for Rhythm CAPTCHA */
.rhythm-reference {
    margin-bottom: 20px;
    text-align: center;
}

.rhythm-reference img {
    width: 200px;
    height: 200px;
    border: 4px solid #0078ff;
    border-radius: 8px;
    background-color: #fff;
}

.rhythm-reference-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.mirror-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.mirror-reference {
    flex: 0 0 240px;
    max-width: 240px;
    background-color: #0f141b;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto;
}

.mirror-reference-label {
    font-weight: 600;
    font-size: 16px;
    color: #ecf0f1;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mirror-reference img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    background-color: #1c2833;
    object-fit: contain;
}

.mirror-options {
    flex: 1 1 480px;
    max-width: 760px;
}

.mirror-options-label {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 12px;
}

.mirror-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.mirror-option {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #333;
    background-color: #111;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 260px;
    aspect-ratio: 1 / 1;
}

.mirror-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mirror-option:hover {
    transform: translateY(-2px);
    border-color: #e74c3c;
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.3);
}

.mirror-option.active {
    border-color: #e74c3c;
    box-shadow: 0 10px 24px rgba(231, 76, 60, 0.35);
    transform: translateY(-3px);
}

.mirror-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(231, 76, 60, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mirror-overlay.active {
    opacity: 1;
}

.mirror-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    color: white;
    font-size: 42px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.mirror-checkmark.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mirror-submit {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 32px;
    clear: both;
}

.submit-mirror {
    padding: 16px 40px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 6px 14px rgba(231, 76, 60, 0.35);
}

.submit-mirror:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

.submit-mirror:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 768px) {
    .mirror-layout {
        flex-direction: column;
    }

    .mirror-reference {
        max-width: none;
        width: 100%;
    }

    .mirror-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .submit-mirror {
        width: 100%;
    }
}

/* Squiggle memory puzzle */
.squiggle-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background-color: #0f141b;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
}

.squiggle-hint {
    font-weight: 600;
    font-size: 16px;
    color: #f1c40f;
    letter-spacing: 0.02em;
}

.squiggle-preview-image {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #ffffff;
}

.squiggle-options-grid {
    display: grid;
    gap: 40px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    justify-content: center;
    grid-auto-flow: row;
}

.squiggle-option {
    border: 2px solid #2c3e50;
    border-radius: 8px;
    background-color: #0f141b;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 240px;
    aspect-ratio: 4 / 3;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.squiggle-option img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #ffffff;
}

.squiggle-option:hover {
    transform: translateY(-2px);
    border-color: #9b59b6;
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.25);
}

.squiggle-option.active {
    border-color: #9b59b6;
    box-shadow: 0 10px 24px rgba(155, 89, 182, 0.35);
}

.squiggle-submit {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 32px;
    clear: both;
}

.submit-squiggle {
    padding: 14px 32px;
    background-color: #9b59b6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(155, 89, 182, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-squiggle:hover {
    background-color: #8e44ad;
    transform: translateY(-1px);
}

.submit-squiggle:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 600px) {
    .squiggle-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 24px;
        padding: 0 10px;
    }

    .squiggle-preview {
        padding: 16px;
    }
}

/* Transform Pipeline puzzle */
.transform-pipeline-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.transform-pipeline-reference {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.transform-pipeline-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.transform-pipeline-label {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.transform-pipeline-ref-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    padding: 8px;
}

.transform-pipeline-steps-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    text-align: left;
}

.transform-pipeline-step {
    padding: 10px 16px;
    background-color: #ffffff;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.5;
}

.transform-pipeline-options-grid {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    justify-content: center;
}

.transform-pipeline-option {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 200px;
    aspect-ratio: 4 / 3;
    max-width: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transform-pipeline-option img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #ffffff;
    padding: 8px;
}

.transform-pipeline-option:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.transform-pipeline-option.active {
    border-color: var(--primary-color);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.35);
    background-color: rgba(99, 102, 241, 0.05);
}

.transform-pipeline-submit {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.submit-transform-pipeline {
    padding: 14px 32px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-transform-pipeline:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.submit-transform-pipeline:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

.puzzle-image-container:has(.transform-pipeline-container) {
    display: block;
    flex-direction: column;
}

@media (max-width: 600px) {
    .transform-pipeline-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }

    .transform-pipeline-container {
        padding: 16px;
    }

    .transform-pipeline-ref-image {
        max-height: 200px;
    }

    .transform-pipeline-step {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Color Cipher puzzle */
.color-cipher-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background-color: #0f141b;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    margin: 0 auto;
    color: #ecf0f1;
    text-align: center;
}

.color-cipher-title {
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.03em;
}

.color-cipher-mapping {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.color-cipher-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 600;
    background-color: rgba(236, 240, 241, 0.08);
    border-radius: 8px;
    padding: 10px 16px;
}

.color-cipher-symbol {
    font-size: 32px;
}

.color-cipher-value {
    font-size: 24px;
}

.color-cipher-question {
    margin-top: 20px;
    font-size: 36px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    padding: 20px 40px;
    width: 100%;
    display: block;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .color-cipher-preview {
        padding: 16px;
    }

    .color-cipher-row {
        font-size: 24px;
    }

    .color-cipher-symbol {
        font-size: 28px;
    }

    .color-cipher-value {
        font-size: 20px;
    }
}

.fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.firework-burst {
    position: absolute;
    transform: translate(-50%, -50%);
}

.firework-spark {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: firework-burst 0.9s ease-out forwards;
    opacity: 0;
}

.firework-spark::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
}

@keyframes firework-burst {
    0% {
        transform: translate(0, 0) scale(0.2);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(1);
        opacity: 0;
    }
}

.firework-spark:nth-child(12n + 1) { --x: 70px;  --y: -20px; }
.firework-spark:nth-child(12n + 2) { --x: 40px;  --y: -70px; }
.firework-spark:nth-child(12n + 3) { --x: 5px;   --y: -90px; }
.firework-spark:nth-child(12n + 4) { --x: -55px; --y: -65px; }
.firework-spark:nth-child(12n + 5) { --x: -85px; --y: -5px; }
.firework-spark:nth-child(12n + 6) { --x: -60px; --y: 50px; }
.firework-spark:nth-child(12n + 7) { --x: -15px; --y: 85px; }
.firework-spark:nth-child(12n + 8) { --x: 35px;  --y: 80px; }
.firework-spark:nth-child(12n + 9) { --x: 80px;  --y: 40px; }
.firework-spark:nth-child(12n + 10) { --x: 95px; --y: -40px; }
.firework-spark:nth-child(12n + 11) { --x: 20px; --y: -120px; }
.firework-spark:nth-child(12n + 12) { --x: -90px; --y: -45px; }

.sad-face-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25));
    pointer-events: none;
    animation: sad-face-pop 1.1s ease forwards;
    z-index: 9999;
}

@keyframes sad-face-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
}

.object-image-container::before {
    content: "Rotate to match";
}

#reference-image,
#object-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

/* Rotation controls */
.rotation-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
}

.rotate-left,
.rotate-right {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2980b9;
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.rotate-left:hover,
.rotate-right:hover {
    background-color: #3498db;
}

.rotate-left:active,
.rotate-right:active {
    background-color: #1c638d;
}

/* Submit button for rotation puzzles */
.rotation-submit {
    text-align: center;
    margin-top: 15px;
}

.submit-rotation {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-rotation:hover {
    background-color: #2ecc71;
}

.submit-rotation:active {
    background-color: #219653;
}

/* Ensure the puzzle container properly displays rotation puzzles */
.puzzle-image-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rotation-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .reference-image-container,
    .object-image-container {
        flex: 0 0 100%;
    }
}

/* Slider Puzzle Styles */
.background-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slider-component {
    position: absolute;
    cursor: move;
    user-select: none;
    touch-action: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.2s ease;
}

.slider-component:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.slider-component:active {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.slider-submit {
    margin-top: 15px;
    text-align: center;
}

.submit-slider {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.submit-slider:hover {
    background-color: #45a049;
}

.submit-slider:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Hover instructions for the slider */
.background-container::before {
    content: "Drag the puzzle piece to the correct position";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.background-container:hover::before {
    opacity: 1;
}

/* Add responsive styles for smaller screens */
@media (max-width: 600px) {
    .background-container {
        max-width: 100%;
    }
    
    .slider-component img {
        max-width: 100%;
    }
}

/* Target area marker for slider puzzle debug */
.target-area {
    position: absolute;
    border-radius: 50%;
    border: 2px dashed #00cc00;
    background-color: rgba(0, 204, 0, 0.2);
    pointer-events: none;
    z-index: 5;
    animation: pulse-green 1.5s infinite alternate;
}

@keyframes pulse-green {
    from {
        box-shadow: 0 0 0 0 rgba(0, 204, 0, 0.4);
        background-color: rgba(0, 204, 0, 0.2);
    }
    to {
        box-shadow: 0 0 0 10px rgba(0, 204, 0, 0);
        background-color: rgba(0, 204, 0, 0.3);
    }
}

/* Debugging coordinates label */
.coords-label {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 20;
}

/* Unusual Detection Grid Styles */
.unusual-detection-grid {
    display: grid;
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.grid-cell {
    position: relative;
    cursor: pointer;
    border: 2px solid #333;
    overflow: hidden;
    transition: transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.grid-cell:hover {
    transform: scale(0.98);
}

.cell-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cell-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 120, 255, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 32px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 3;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.submit-unusual {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.submit-unusual:hover {
    background-color: #45a049;
}

.submit-unusual:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* End Unusual Detection Styles */

/* Image Matching Styles */
.matching-layout {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.option-image-container {
    flex: 0 0 45%;
    text-align: center;
    position: relative;
}

.option-image-container::before {
    content: "Match This";
}

#option-image {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

/* Navigation controls */
.image-matching-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    gap: 20px;
}

.navigate-left,
.navigate-right {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2980b9;
    color: white;
    font-size: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.navigate-left:hover,
.navigate-right:hover {
    background-color: #3498db;
}

.navigate-left:active,
.navigate-right:active {
    background-color: #1c638d;
}

/* Indicator dots */
.indicator-dots {
    display: flex;
    gap: 5px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #bdc3c7;
    transition: background-color 0.2s;
}

.dot.active {
    background-color: #2980b9;
}

/* Submit button for image matching */
.image-matching-submit {
    text-align: center;
    margin-top: 15px;
}

.submit-image-matching {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-image-matching:hover {
    background-color: #2ecc71;
}

.submit-image-matching:active {
    background-color: #219653;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .matching-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .reference-image-container,
    .option-image-container {
        flex: 0 0 100%;
    }
}

/* Add styles for Patch Select grid */
.patch-select-grid {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border: 2px solid #ccc;
    overflow: hidden;
    position: relative;
    height: 450px; /* Set a fixed height */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.patch-select-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.patch-select-image-container img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.patch-select-cell {
    position: relative;
    z-index: 1;
    min-height: 80px; /* Increase minimum height */
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.patch-select-cell:hover {
    background-color: rgba(0, 123, 255, 0.2);
    border: 3px solid rgba(0, 123, 255, 0.7);
}

.patch-select-cell.selected {
    background-color: rgba(0, 123, 255, 0.3);
    border: 3px solid rgba(0, 123, 255, 0.8);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Object Match Styles */
.object-match-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.object-match-horizontal-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.object-match-reference,
.object-match-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 300px;
    position: relative;
}

.object-match-reference-img,
.object-match-option-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    max-height: 200px;
    object-fit: contain;
}

.object-match-caption {
    font-weight: bold;
    font-size: 16px;
    margin-top: 5px;
}

.object-match-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
}

.object-match-arrow {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.object-match-arrow:hover {
    background-color: #45a049;
}

.object-match-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.object-match-dot {
    width: 10px;
    height: 10px;
    background-color: #ddd;
    border-radius: 50%;
    cursor: pointer;
}

.object-match-dot.active {
    background-color: #4CAF50;
}

.object-match-submit {
    padding: 10px 20px;
    background-color: #4CAF50;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}

.object-match-submit:hover {
    background-color: #45a049;
}

/* Responsive adjustments for Object Match */
@media (max-width: 768px) {
    .object-match-horizontal-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .object-match-reference,
    .object-match-options {
        width: 100%;
    }
}

/* Dart Count Styles */
.dart-count-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.dart-count-horizontal-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.dart-count-reference,
.dart-count-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 300px;
    position: relative;
}

.dart-count-reference-img,
.dart-count-option-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
    max-height: 200px;
    object-fit: contain;
}

.dart-count-caption {
    font-weight: bold;
    font-size: 16px;
    margin-top: 5px;
}

.dart-count-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
}

.dart-count-arrow {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dart-count-arrow:hover {
    background-color: #45a049;
}

.dart-count-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.dart-count-dot {
    width: 10px;
    height: 10px;
    background-color: #ddd;
    border-radius: 50%;
    cursor: pointer;
}

.dart-count-dot.active {
    background-color: #4CAF50;
}

.dart-count-submit {
    padding: 10px 20px;
    background-color: #4CAF50;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}


.dart-count-submit:hover {
    background-color: #45a049;
}

/* Responsive adjustments for Dart Count */
@media (max-width: 768px) {
    .dart-count-horizontal-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .dart-count-reference,
    .dart-count-options {
        width: 100%;
    }
}

/* Difficulty stars styling */
.difficulty-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.difficulty-stars .star {
    color: #fbbf24;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.4));
    transition: var(--transition);
}

.difficulty-stars .star:not(.filled) {
    color: #e5e7eb;
    filter: none;
}

.puzzle-difficulty {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    background-color: var(--surface);
    padding: 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.puzzle-difficulty span {
    margin-right: 5px;
}

/* === Special Effects for Answer Results === */

.sad-face-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    font-size: 150px;
    animation: sad-face-animation 1.6s forwards;
    opacity: 0;
}

@keyframes sad-face-animation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }
}

.result-message.correct {
    color: #2ecc71;
    animation: bounce 0.5s;
    font-size: 1.5em;
    text-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
}

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

.result-message.incorrect {
    color: #e74c3c;
    animation: shake 0.5s;
    font-size: 1.5em;
    text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

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

/* ============================================================
   Interactive 3D Dice Reference Styles for Dice_Roll_Path
   ============================================================ */

.dice-roll-reference-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.dice-3d-reference {
    background: linear-gradient(145deg, #f0f9ff, #e0f2fe);
    border: 2px solid #0ea5e9;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 300px;
}

.dice-3d-title {
    font-size: 17px;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dice-3d-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: -8px;
}

.dice-3d-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    font-style: italic;
}

.dice-3d-canvas-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background: #f8fafc;
}

.dice-3d-canvas-container canvas {
    display: block;
}

.dice-3d-top-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.dice-3d-top-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.dice-3d-top-value {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    min-width: 36px;
    text-align: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dice-3d-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.dice-3d-btn-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.dice-3d-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: white;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-3d-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
}

.dice-3d-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-3d-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.dice-3d-reset-btn {
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dice-3d-reset-btn:hover:not(:disabled) {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: linear-gradient(145deg, #f0f9ff, #e0f2fe);
    box-shadow: 0 3px 8px rgba(14, 165, 233, 0.15);
}

.dice-3d-reset-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dice-roll-reference-container {
        padding: 0 10px;
    }

    .dice-3d-reference {
        min-width: 280px;
        padding: 16px;
    }

    .dice-3d-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}

/* ============================================================
   Interactive 3D Viewpoint Reference Styles
   ============================================================ */

.viewpoint-viewer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.viewpoint-3d-reference {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid #0078ff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 16px rgba(0, 120, 255, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.viewpoint-3d-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.viewpoint-3d-canvas-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: #ffffff;
}

.viewpoint-3d-canvas-container canvas {
    display: block;
}

.viewpoint-3d-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.viewpoint-3d-btn-row {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.viewpoint-3d-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(145deg, #0078ff, #0056b3);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 120, 255, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.viewpoint-3d-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.viewpoint-3d-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 120, 255, 0.45),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, #1a8cff, #0078ff);
}

.viewpoint-3d-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 120, 255, 0.3);
    background: linear-gradient(145deg, #0056b3, #004494);
}

.viewpoint-3d-reset-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #3d4f6f;
    border-radius: 6px;
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    color: #8892b0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-top: 4px;
}

.viewpoint-3d-reset-btn:hover {
    border-color: #0078ff;
    color: #0078ff;
    background: linear-gradient(145deg, #1e2a4a, #1a1a2e);
}

/* Responsive adjustments for viewpoint */
@media (max-width: 768px) {
    .viewpoint-viewer-container {
        padding: 0 10px;
    }

    .viewpoint-3d-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .viewpoint-3d-btn-sm {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}
