/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Hiragino Sans', 'Meiryo', 'Noto Sans JP', sans-serif; background: #fafafa; color: #333; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ===== COLORS ===== */
:root { --primary: #FF6B6B; --primary-dark: #e55555; --accent: #4ECDC4; --accent-dark: #3dbdb5; --dark: #2d3436; --light: #fafafa; --gray: #636e72; --light-gray: #dfe6e9; }

/* ===== NAVBAR ===== */
.navbar { background: var(--dark); color: white; padding: 1rem 0; position: sticky; top: 0; z-index: 1000; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-size: 1.3rem; font-weight: bold; }
.logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { opacity: 0.85; transition: opacity 0.3s; }
.nav-links a:hover, .nav-links a.active { opacity: 1; color: var(--primary); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.hamburger span { width: 25px; height: 3px; background: white; border-radius: 2px; transition: 0.3s; }
.mobile-menu { display: none; background: var(--dark); padding: 1rem; }
.mobile-menu a { display: block; color: white; padding: 0.75rem 0; border-bottom: 1px solid #444; }
.mobile-menu.open { display: block; }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, var(--primary), var(--accent)); color: white; text-align: center; padding: 4rem 0; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; opacity: 0.95; }

/* ===== GAME GRID ===== */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; padding: 2rem 0; }
.game-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; }
.game-card:hover { transform: translateY(-5px); box-shadow: 0 5px 20px rgba(0,0,0,0.15); }
.game-card img { width: 100%; height: 160px; object-fit: cover; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.game-card-body { padding: 1rem; }
.game-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--dark); }
.game-card p { font-size: 0.9rem; color: var(--gray); }

/* ===== GAME CONTAINER ===== */
.game-container { max-width: 700px; margin: 2rem auto; background: white; border-radius: 16px; padding: 2rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.game-header { text-align: center; margin-bottom: 1.5rem; }
.game-header h1 { color: var(--primary); font-size: 1.8rem; margin-bottom: 0.5rem; }
.game-header p { color: var(--gray); }
.game-area { background: var(--light-gray); border-radius: 12px; min-height: 400px; display: flex; align-items: center; justify-content: center; flex-direction: column; position: relative; overflow: hidden; }
.game-score { display: flex; justify-content: space-around; margin-bottom: 1rem; font-size: 1.2rem; font-weight: bold; }
.score-item { background: white; padding: 0.5rem 1rem; border-radius: 8px; }
.score-item span { color: var(--primary); }
.game-controls { text-align: center; margin-top: 1rem; }
.btn { background: var(--primary); color: white; border: none; padding: 0.75rem 2rem; border-radius: 8px; font-size: 1rem; cursor: pointer; transition: background 0.3s; }
.btn:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: var(--accent-dark); }

/* ===== ARTICLE ===== */
.article-container { max-width: 800px; margin: 2rem auto; background: white; border-radius: 16px; padding: 2.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.article-container h1 { color: var(--primary); font-size: 1.8rem; margin-bottom: 1rem; }
.article-container h2 { color: var(--dark); font-size: 1.4rem; margin: 1.5rem 0 1rem; }
.article-container p { margin-bottom: 1rem; line-height: 1.8; }
.article-meta { color: var(--gray); font-size: 0.9rem; margin-bottom: 1.5rem; }
.article-container ul { margin: 1rem 0 1rem 1.5rem; list-style: disc; }
.article-container li { margin-bottom: 0.5rem; }

/* ===== FOOTER ===== */
.footer { background: var(--dark); color: white; text-align: center; padding: 2rem 0; margin-top: 3rem; }
.footer a { color: var(--accent); }

/* ===== WHACK-A-MOLE ===== */
.mole-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; width: 100%; max-width: 400px; }
.hole { width: 100px; height: 100px; background: #8B4513; border-radius: 50%; position: relative; overflow: hidden; margin: 0 auto; }
.hole::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background: #5D3A1A; border-radius: 0 0 50px 50px; }
.mole { width: 70px; height: 70px; background: #D2691E; border-radius: 50%; position: absolute; bottom: -70px; left: 50%; transform: translateX(-50%); transition: bottom 0.1s; cursor: pointer; }
.mole.active { bottom: 15px; }
.mole:active { transform: translateX(-50%) scale(0.9); }

/* ===== REACTION TESTER ===== */
.color-box { width: 300px; height: 300px; border-radius: 20px; background: var(--accent); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white; font-weight: bold; transition: background 0.3s; }

/* ===== BALLOON ===== */
.balloon-area { position: relative; width: 100%; height: 400px; background: linear-gradient(to bottom, #87CEEB, #E0F6FF); border-radius: 12px; overflow: hidden; }
.balloon { position: absolute; font-size: 3rem; cursor: pointer; animation: floatUp 3s linear forwards; }
@keyframes floatUp { 0% { bottom: -50px; } 100% { bottom: 450px; } }

/* ===== CATCH GAME ===== */
.catch-area { position: relative; width: 100%; height: 400px; background: #1a1a2e; border-radius: 12px; overflow: hidden; }
.falling-item { position: absolute; font-size: 2rem; top: -50px; }
.catcher { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 3rem; }

/* ===== MEMORY GAME ===== */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; max-width: 400px; margin: 0 auto; }
.memory-card { aspect-ratio: 1; background: var(--primary); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: white; transition: transform 0.3s; }
.memory-card.flipped { background: white; transform: rotateY(180deg); }
.memory-card.matched { background: var(--accent); pointer-events: none; }

/* ===== SUDOKU ===== */
.sudoku-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; max-width: 320px; margin: 0 auto; background: var(--dark); padding: 2px; border-radius: 8px; }
.sudoku-cell { aspect-ratio: 1; background: white; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; cursor: pointer; }
.sudoku-cell:hover { background: #f0f0f0; }
.sudoku-cell.selected { background: #FFE4B5; }
.sudoku-cell.correct { color: var(--accent); }
.sudoku-cell.wrong { color: var(--primary); }
.sudoku-cell.fixed { color: var(--dark); pointer-events: none; }

/* ===== WORD SEARCH ===== */
.word-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; max-width: 400px; margin: 1rem auto; }
.word-cell { aspect-ratio: 1; background: white; display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: bold; cursor: pointer; border: 1px solid var(--light-gray); }
.word-cell.selected { background: var(--accent); color: white; }
.word-cell.found { background: var(--primary); color: white; }

/* ===== SLIDING PUZZLE ===== */
.sliding-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 280px; margin: 1rem auto; background: var(--dark); padding: 4px; border-radius: 8px; }
.sliding-tile { aspect-ratio: 1; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; color: white; cursor: pointer; border-radius: 4px; transition: 0.2s; }
.sliding-tile:hover { background: var(--primary-dark); }
.sliding-tile.empty { background: transparent; cursor: default; }

/* ===== MATH DASH ===== */
.math-question { font-size: 2.5rem; font-weight: bold; color: var(--dark); margin: 1rem 0; }
.math-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 400px; margin: 1rem auto; }
.math-option { padding: 1rem; background: white; border: 2px solid var(--light-gray); border-radius: 12px; font-size: 1.5rem; cursor: pointer; transition: all 0.3s; }
.math-option:hover { border-color: var(--primary); background: #FFF5F5; }

/* ===== 24 GAME ===== */
.game24-input { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.game24-input input { width: 60px; height: 60px; text-align: center; font-size: 1.5rem; border: 2px solid var(--light-gray); border-radius: 8px; }
.game24-expr { width: 200px; height: 50px; text-align: center; font-size: 1.3rem; border: 2px solid var(--accent); border-radius: 8px; }

/* ===== 2048 ===== */
.game2048 { max-width: 400px; margin: 0 auto; }
.game2048-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--dark); padding: 8px; border-radius: 8px; }
.game2048-cell { aspect-ratio: 1; background: #ccc; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: bold; border-radius: 4px; }
.tile-2 { background: #eee4da; color: #776e65; }
.tile-4 { background: #ede0c8; color: #776e65; }
.tile-8 { background: #f2b179; color: white; }
.tile-16 { background: #f59563; color: white; }
.tile-32 { background: #f67c5f; color: white; }
.tile-64 { background: #f65e3b; color: white; }
.tile-128 { background: #edcf72; color: white; }
.tile-256 { background: #edcc61; color: white; }
.tile-512 { background: #edc850; color: white; }
.tile-1024 { background: #edc53f; color: white; }
.tile-2048 { background: #edc22e; color: white; }

/* ===== 1-50 GAME ===== */
.number-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; max-width: 350px; margin: 1rem auto; }
.num-btn { aspect-ratio: 1; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 1.3rem; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.num-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.num-btn.found { background: var(--accent); pointer-events: none; }

/* ===== HANGMAN ===== */
.hangman-word { display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0; font-size: 2rem; letter-spacing: 0.5rem; }
.hangman-word span { border-bottom: 3px solid var(--dark); width: 30px; text-align: center; }
.hangman-letters { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; max-width: 400px; margin: 1rem auto; }
.hangman-letter { width: 40px; height: 40px; background: white; border: 2px solid var(--primary); border-radius: 8px; cursor: pointer; font-size: 1.2rem; font-weight: bold; transition: all 0.2s; }
.hangman-letter:hover { background: var(--primary); color: white; }
.hangman-letter.used { background: var(--light-gray); border-color: var(--gray); color: var(--gray); cursor: default; pointer-events: none; }

/* ===== EMOJI GUESS ===== */
.emoji-display { font-size: 5rem; margin: 1rem 0; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.emoji-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 400px; margin: 1rem auto; }
.emoji-option { padding: 1rem; background: white; border: 2px solid var(--light-gray); border-radius: 12px; font-size: 1.2rem; cursor: pointer; transition: all 0.3s; }
.emoji-option:hover { border-color: var(--primary); }

/* ===== DRESS UP ===== */
.dressup-area { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; }
.dressup-character { width: 200px; height: 300px; background: #f0f0f0; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 20px; position: relative; }
.dressup-item { position: absolute; font-size: 3rem; cursor: pointer; transition: transform 0.3s; }
.dressup-item:hover { transform: scale(1.1); }
.dressup-item.hat { top: 10px; }
.dressup-item.face { top: 80px; }
.dressup-item.body { top: 150px; }
.dressup-item.shoes { bottom: 20px; }
.dressup-clothes { display: flex; flex-direction: column; gap: 0.5rem; }
.clothing-option { padding: 0.5rem 1rem; background: white; border: 2px solid var(--light-gray); border-radius: 8px; cursor: pointer; font-size: 1.5rem; }
.clothing-option:hover { border-color: var(--accent); }
.clothing-option.selected { border-color: var(--primary); background: #FFF5F5; }

/* ===== PET SIM ===== */
.pet-area { width: 300px; height: 300px; background: linear-gradient(to bottom, #87CEEB 50%, #90EE90 50%); border-radius: 12px; position: relative; overflow: hidden; margin: 0 auto; }
.pet { font-size: 5rem; position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); transition: all 0.5s; }
.pet.happy { animation: bounce 0.5s infinite; }
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-20px); } }
.pet-food { font-size: 2rem; position: absolute; bottom: 20px; cursor: pointer; }
.pet-toy { font-size: 2rem; position: absolute; bottom: 20px; right: 20px; cursor: pointer; }
.pet-stats { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; }

/* ===== PIZZA MAKER ===== */
.pizza-base { width: 250px; height: 250px; background: #F4A460; border-radius: 50%; position: relative; margin: 1rem auto; }
.pizza-topping { position: absolute; font-size: 1.5rem; }
.topping-options { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.topping-btn { padding: 0.5rem 1rem; background: white; border: 2px solid var(--light-gray); border-radius: 20px; cursor: pointer; font-size: 1.5rem; }
.topping-btn:hover { border-color: var(--accent); }
.topping-btn.selected { border-color: var(--primary); background: #FFF5F5; }

/* ===== BURGER STACK ===== */
.burger-stack { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; margin: 1rem auto; width: 200px; }
.burger-layer { width: 180px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.bun-top { background: #D2691E; border-radius: 100px 100px 5px 5px; }
.bun-bottom { background: #D2691E; border-radius: 5px 5px 100px 100px; }
.meat { background: #8B4513; }
.cheese { background: #FFD700; height: 15px; }
.lettuce { background: #32CD32; height: 20px; }
.tomato { background: #FF6347; height: 15px; }
.burger-options { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.burger-btn { padding: 0.5rem 1rem; background: white; border: 2px solid var(--light-gray); border-radius: 8px; cursor: pointer; font-size: 1.2rem; }
.burger-btn:hover { border-color: var(--accent); }

/* ===== COOKIE DECORATOR ===== */
.cookie { width: 250px; height: 250px; background: radial-gradient(circle, #D2691E 60%, #8B4513 100%); border-radius: 50%; position: relative; margin: 1rem auto; }
.decorator { position: absolute; font-size: 1.5rem; cursor: move; }
.decorator-options { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 1rem 0; }
.deco-btn { padding: 0.5rem 1rem; background: white; border: 2px solid var(--light-gray); border-radius: 20px; cursor: pointer; font-size: 1.2rem; }
.deco-btn.selected { border-color: var(--primary); background: #FFF5F5; }

/* ===== PLATFORM JUMP ===== */
.jump-canvas { width: 100%; max-width: 600px; height: 400px; background: #1a1a2e; border-radius: 12px; display: block; margin: 0 auto; }

/* ===== SNAKE GAME ===== */
.snake-canvas { width: 100%; max-width: 400px; height: 400px; background: #111; border-radius: 8px; display: block; margin: 0 auto; border: 4px solid var(--dark); }

/* ===== TETRIS ===== */
.tetris-canvas { width: 100%; max-width: 300px; height: 500px; background: #111; border-radius: 8px; display: block; margin: 0 auto; border: 4px solid var(--dark); }

/* ===== PONG ===== */
.pong-canvas { width: 100%; max-width: 600px; height: 400px; background: #000; border-radius: 8px; display: block; margin: 0 auto; border: 4px solid var(--dark); }

/* ===== FLAPPY BIRD ===== */
.flappy-canvas { width: 100%; max-width: 400px; height: 500px; background: #70c5ce; border-radius: 8px; display: block; margin: 0 auto; border: 4px solid var(--dark); }

/* ===== SPACE INVADERS ===== */
.invader-canvas { width: 100%; max-width: 500px; height: 400px; background: #000; border-radius: 8px; display: block; margin: 0 auto; border: 4px solid var(--dark); }

/* ===== BREAKOUT ===== */
.breakout-canvas { width: 100%; max-width: 600px; height: 400px; background: #111; border-radius: 8px; display: block; margin: 0 auto; border: 4px solid var(--dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .hero h1 { font-size: 1.8rem; }
    .game-container { margin: 1rem; padding: 1rem; }
    .article-container { margin: 1rem; padding: 1.5rem; }
    .memory-grid { grid-template-columns: repeat(4, 1fr); }
    .mole-grid { max-width: 300px; }
    .color-box { width: 200px; height: 200px; }
}
