/* ===================================
   CAPTCHA GAME - CLEAN CAPTCHA AESTHETIC
   =================================== */

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

:root {
    --primary-blue: #3498db;
    --primary-blue-dark: #2980b9;
    --success-green: #27ae60;
    --error-red: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #ecf0f1;
    --bg-white: #ffffff;
    --border-gray: #bdc3c7;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* ===================================
   VIEW ALL GAMES BUTTON
   =================================== */

.view-all-games {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.view-all-games:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: var(--bg-white);
}

/* ===================================
   MAIN CONTAINER
   =================================== */

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

/* ===================================
   HEADER
   =================================== */

.game-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.game-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.robot-icon {
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

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

.game-subtitle {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 500;
}

/* ===================================
   PROGRESS BAR
   =================================== */

.progress-bar {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px var(--shadow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--success-green));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ===================================
   CAPTCHA BOX (Main Challenge Area)
   =================================== */

.captcha-box {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid var(--border-gray);
}

.captcha-header {
    background: var(--bg-light);
    padding: 20px;
    border-bottom: 2px solid var(--border-gray);
}

.captcha-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

.captcha-content {
    padding: 40px 30px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.captcha-footer {
    padding: 20px 30px;
    background: var(--bg-light);
    border-top: 2px solid var(--border-gray);
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ===================================
   BUTTONS
   =================================== */

.captcha-btn {
    padding: 12px 30px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.captcha-btn:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.4);
}

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

.captcha-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.captcha-btn.secondary {
    background: var(--text-light);
    box-shadow: 0 4px 10px rgba(127, 140, 141, 0.3);
}

.captcha-btn.secondary:hover {
    background: #95a5a6;
}

/* ===================================
   CHALLENGE COMPONENTS
   =================================== */

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 20px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
}

.checkbox-container:hover {
    border-color: var(--primary-blue);
    background: rgba(52, 152, 219, 0.05);
}

.checkbox-box {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: white;
}

.checkbox-box.checked {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox-box.checked::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.checkbox-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Text Input */
.text-input-container {
    width: 100%;
    text-align: center;
}

.distorted-text {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 4px;
    color: var(--text-dark);
    text-shadow: 2px 2px 4px var(--shadow);
    font-family: 'Courier New', monospace;
    user-select: none;
}

.distorted-text.glitch {
    animation: glitch 0.5s infinite;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(-2px, 2px); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, -2px); }
}

.text-input {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 18px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Canvas (for rotate puzzles) */
.canvas-container {
    position: relative;
    display: inline-block;
}

/* Jigsaw Puzzle */
.jigsaw-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
}

.jigsaw-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    background: var(--bg-light);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--border-gray);
}

.jigsaw-slot {
    width: 100px;
    height: 100px;
    background: white;
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.jigsaw-slot:empty {
    background: rgba(52, 152, 219, 0.05);
}

.jigsaw-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    min-height: 120px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 2px dashed var(--border-gray);
}

.jigsaw-piece {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
    position: relative;
}

.jigsaw-piece:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.jigsaw-piece.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.jigsaw-piece.correct-placement {
    border-color: var(--success-green);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.3);
}

.piece-emoji {
    font-size: 48px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    user-select: none;
    pointer-events: none;
}

/* Grid Selection */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 350px;
}

.grid-item {
    aspect-ratio: 1;
    border: 3px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--bg-light);
}

.grid-item:hover {
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

.grid-item.selected {
    border-color: var(--primary-blue);
    background: rgba(52, 152, 219, 0.1);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* Slider */
.slider-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.slider-target {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-blue);
}

.slider-input {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    background: var(--bg-light);
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
}

.slider-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-blue);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px var(--shadow);
}

.slider-value {
    font-size: 20px;
    font-weight: 600;
    margin-top: 10px;
    color: var(--text-dark);
}

/* Rotate Challenge */
.rotate-container {
    text-align: center;
}

.rotate-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.rotate-btn {
    padding: 10px 20px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rotate-btn:hover {
    background: var(--primary-blue-dark);
}

/* ===================================
   GAME CONTROLS
   =================================== */

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.control-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    color: var(--text-dark);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: white;
}

/* ===================================
   STATS DISPLAY
   =================================== */

.stats-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    gap: 30px;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow);
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-blue);
}

/* ===================================
   OVERLAYS (Victory/Failure)
   =================================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.overlay-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

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

.overlay-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.overlay-message {
    font-size: 18px;
    margin-bottom: 25px;
    color: var(--text-light);
    line-height: 1.6;
}

.overlay-stats {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.overlay-stats p {
    font-size: 16px;
    font-weight: 600;
    margin: 8px 0;
    color: var(--text-dark);
}

.overlay-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.overlay-btn {
    padding: 14px 28px;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow);
}

.overlay-btn.primary {
    background: var(--primary-blue);
}

.overlay-btn.primary:hover {
    background: var(--primary-blue-dark);
}

/* ===================================
   HOW TO PLAY SECTION
   =================================== */

.how-to-play {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px var(--shadow);
}

.how-to-play h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.instruction {
    text-align: center;
}

.instruction-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.instruction h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.instruction p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.challenge-types {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px;
}

.challenge-types h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.challenge-types ul {
    list-style: none;
    padding: 0;
}

.challenge-types li {
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-gray);
}

.challenge-types li:last-child {
    border-bottom: none;
}

/* ===================================
   FOOTER
   =================================== */

.game-footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    font-size: 14px;
}

.game-footer p {
    margin: 8px 0;
}

.game-footer a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    transition: opacity 0.3s ease;
}

.game-footer a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* ===================================
   ANIMATIONS
   =================================== */

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

.shake {
    animation: shake 0.5s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 0.5s ease;
}

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

.bounce {
    animation: bounce 0.6s ease;
}

/* ===================================
   POODLE VS FRIED CHICKEN GRID
   =================================== */

.image-grid.large-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 500px;
}

.grid-item.image-item {
    padding: 0;
    background: white;
    position: relative;
}

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

/* ===================================
   LOGO PUZZLE GRID
   =================================== */

.puzzle-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logo-puzzle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    max-width: 350px;
    background: var(--border-gray);
    padding: 5px;
    border-radius: 8px;
}

.logo-puzzle-tile {
    aspect-ratio: 1;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.logo-puzzle-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.logo-puzzle-tile:hover:not(.empty) {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.logo-puzzle-tile.empty {
    background: var(--bg-light);
    border: 2px dashed var(--border-gray);
    cursor: default;
}

/* ===================================
   NERDLE PUZZLE
   =================================== */

.nerdle-container {
    width: 100%;
    text-align: center;
}

.nerdle-clue {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.nerdle-grid {
    display: inline-block;
    margin-bottom: 15px;
}

.nerdle-row {
    display: flex;
    gap: 5px;
}

.nerdle-tile {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 4px;
    color: white;
}

.nerdle-tile.correct {
    background: var(--success-green);
}

.nerdle-tile.wrong-pos {
    background: #9b59b6;
}

.nerdle-tile.wrong {
    background: #95a5a6;
}

.nerdle-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.nerdle-select {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.nerdle-input {
    width: 80px;
    padding: 10px;
    font-size: 18px;
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    text-align: center;
}

/* ===================================
   WORDLE PUZZLE
   =================================== */

.wordle-container {
    width: 100%;
    text-align: center;
}

.wordle-grid {
    display: inline-block;
    margin-bottom: 15px;
}

.wordle-row {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.wordle-tile {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
}

.wordle-tile.correct {
    background: var(--success-green);
}

.wordle-tile.wrong-pos {
    background: #f39c12;
}

.wordle-tile.wrong {
    background: #95a5a6;
}

/* ===================================
   CONNECTIONS PUZZLE
   =================================== */

.connections-container {
    width: 100%;
    text-align: center;
}

.connections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 450px;
    margin: 0 auto;
}

.connections-word {
    padding: 15px 10px;
    background: var(--bg-light);
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.connections-word:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.connections-word.selected {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

/* ===================================
   STRANDS PUZZLE
   =================================== */

.strands-container {
    width: 100%;
    text-align: center;
}

.strands-grid {
    display: inline-grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.strands-letter {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    background: var(--bg-light);
    border: 2px solid var(--border-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.strands-letter:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--primary-blue);
    transform: scale(1.1);
}

.strands-letter.selected {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* ===================================
   CATEGORY SELECTION
   =================================== */

.category-selection {
    max-width: 700px;
    width: 100%;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.category-btn {
    background: var(--bg-white);
    border: 3px solid var(--border-gray);
    border-radius: 16px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.category-btn:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow);
}

.category-btn:active {
    transform: translateY(-2px);
}

.category-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.category-btn h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.category-btn p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

.category-btn.all-categories {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    border-color: var(--primary-blue-dark);
    color: white;
}

.category-btn.all-categories h3 {
    color: white;
}

.category-btn.all-categories p {
    color: rgba(255, 255, 255, 0.9);
}

.category-btn.all-categories:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.4);
}

/* ===================================
   STARDOKU PUZZLE
   =================================== */

.stardoku-container {
    width: 100%;
    text-align: center;
}

.stardoku-info {
    margin-bottom: 20px;
}

.stardoku-info p {
    margin: 8px 0;
    font-size: 15px;
    color: var(--text-dark);
}

.stardoku-info .hint {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

.stardoku-grid {
    display: inline-grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    max-width: 420px;
    margin: 0 auto;
    background: var(--text-dark);
    padding: 2px;
    border: 3px solid var(--text-dark);
    border-radius: 8px;
}

.stardoku-cell {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    font-size: 28px;
    font-weight: bold;
    color: var(--text-dark);
    transition: all 0.2s ease;
    position: relative;
}

.stardoku-cell.fixed {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    cursor: default;
}

.stardoku-cell input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-dark);
    outline: none;
    font-family: inherit;
}

.stardoku-cell input:focus {
    background: rgba(52, 152, 219, 0.05);
}

.stardoku-cell:has(input:focus) {
    box-shadow: inset 0 0 0 2px var(--primary-blue);
}

/* Star sizes */
.star {
    display: inline-block;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.star-1 { font-size: 16px; }
.star-2 { font-size: 20px; }
.star-3 { font-size: 24px; }
.star-4 { font-size: 28px; }
.star-5 { font-size: 32px; }
.star-6 { font-size: 36px; }

/* Region borders */
.stardoku-cell.right-border {
    border-right: 3px solid var(--text-dark);
}

.stardoku-cell.bottom-border {
    border-bottom: 3px solid var(--text-dark);
}

/* Remove number input spinners */
.stardoku-cell input::-webkit-outer-spin-button,
.stardoku-cell input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stardoku-cell input[type=number] {
    -moz-appearance: textfield;
}

/* ===================================
   SHAPES ORDER PUZZLE
   =================================== */

.shapes-container {
    width: 100%;
    text-align: center;
}

.shapes-instruction {
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-dark);
}

.shapes-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.shape-item {
    position: relative;
    cursor: pointer;
    padding: 15px;
    border: 3px solid var(--border-gray);
    border-radius: 12px;
    background: var(--bg-white);
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.shape-item:hover {
    border-color: var(--primary-blue);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.shape-item.shape-selected {
    border-color: var(--success-green);
    background: rgba(46, 204, 113, 0.1);
    cursor: default;
}

.shape-item.shape-selected:hover {
    transform: scale(1);
}

.shape-name {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.shape-order-number {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    background: var(--success-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.shapes-order {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 14px;
}

.shapes-order strong {
    color: var(--text-dark);
    margin-right: 8px;
}

#shapes-order-display {
    color: var(--primary-blue);
    font-weight: 600;
}

/* ===================================
   MAGIC SQUARE PUZZLE
   =================================== */

.magic-square-container {
    width: 100%;
    text-align: center;
}

.magic-square-info {
    margin-bottom: 20px;
}

.magic-square-info p {
    margin: 8px 0;
    font-size: 15px;
    color: var(--text-dark);
}

.magic-square-info .hint {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
}

.magic-square-grid {
    display: inline-grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 360px;
    margin: 0 auto;
}

.magic-cell {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 3px solid var(--border-gray);
    border-radius: 12px;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.magic-cell.fixed {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
    color: white;
    border-color: var(--primary-blue-dark);
    cursor: default;
}

.magic-cell input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
    outline: none;
    font-family: inherit;
}

.magic-cell input:focus {
    background: rgba(52, 152, 219, 0.05);
}

.magic-cell:has(input:focus) {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Remove number input spinners */
.magic-cell input::-webkit-outer-spin-button,
.magic-cell input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.magic-cell input[type=number] {
    -moz-appearance: textfield;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .game-title {
        font-size: 36px;
    }

    .game-subtitle {
        font-size: 16px;
    }

    .captcha-content {
        padding: 30px 20px;
        min-height: 250px;
    }

    .captcha-footer {
        flex-direction: column;
    }

    .captcha-btn {
        width: 100%;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .category-btn {
        padding: 25px 15px;
    }

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

    .instructions-grid {
        grid-template-columns: 1fr;
    }

    .how-to-play {
        padding: 25px;
    }

    .overlay-content {
        padding: 30px 20px;
    }

    .overlay-title {
        font-size: 28px;
    }

    .view-all-games {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding: 10px;
    }

    .image-grid {
        max-width: 100%;
        gap: 8px;
    }

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

    .stats-display {
        flex-direction: column;
        gap: 15px;
    }

    .logo-puzzle-grid {
        max-width: 300px;
    }

    .image-grid.large-grid {
        max-width: 100%;
        gap: 6px;
    }

    .jigsaw-slot,
    .jigsaw-piece {
        width: 80px;
        height: 80px;
    }

    .piece-emoji {
        font-size: 36px;
    }

    .connections-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .strands-letter {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .nerdle-tile,
    .wordle-tile {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .magic-square-grid {
        max-width: 300px;
    }

    .magic-cell {
        width: 80px;
        height: 80px;
    }

    .magic-cell input {
        font-size: 28px;
    }

    .stardoku-grid {
        max-width: 360px;
    }

    .stardoku-cell {
        width: 50px;
        height: 50px;
    }

    .stardoku-cell input {
        font-size: 20px;
    }

    .star-1 { font-size: 14px; }
    .star-2 { font-size: 17px; }
    .star-3 { font-size: 20px; }
    .star-4 { font-size: 23px; }
    .star-5 { font-size: 26px; }
    .star-6 { font-size: 29px; }
}
