* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 10px;
}
.container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 430px;
    width: 100%;
    position: relative;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 8px 56px 10px 56px;
    border-bottom: 2px solid #eee;
}
.title { font-size: 24px; font-weight: bold; }
.level { font-size: 13px; color: #999; line-height: 1.35; }
.score-value { font-size: 28px; font-weight: bold; color: #667eea; text-align: right; }
.score-label { font-size: 11px; color: #999; text-align: right; }
.small-actions { display:flex; gap:8px; margin-top:6px; justify-content:flex-end; }
.small-btn {
    padding: 8px 14px; min-width:72px; min-height:40px; line-height:1; display:inline-flex; align-items:center; justify-content:center;
    border:none; border-radius:999px; cursor:pointer; font-size:14px; font-weight:bold; white-space:nowrap;
    background:#f2f2f2;
}
.small-btn.active { background:#667eea; color:#fff; }
.stats, .substats { display: flex; gap: 10px; margin-bottom: 12px; }
.stat {
    flex: 1;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}
.stat-label { font-size: 11px; color: #999; margin-bottom: 3px; }
.stat-value { font-size: 20px; font-weight: bold; }
.grid-wrapper {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    background: #667eea;
    padding: 8px;
    border-radius: 10px;
    margin-bottom: 15px;
    aspect-ratio: 1;
}
.cell {
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    aspect-ratio: 1;
    position: relative;
}
.cell:hover { background: #f0f0ff; transform: scale(1.05); }
.cell.selected { background: #ffd700; box-shadow: 0 0 0 3px #ff6b00; transform: scale(1.08); }
.cell.hint { animation: hintPulse 0.9s ease-in-out 3; background: #fff3cd; box-shadow: 0 0 0 3px #ffb300 inset; }
.cell.special-row, .cell.special-col { background: #eef4ff; font-size: 20px; }
.cell.special-bomb { background: #ffe5e5; font-size: 20px; }
.cell.locked::before, .cell.crate::before, .cell.chain::before, .cell.stone::before { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; border-radius:6px; font-size:18px; }
.cell.locked::before { content:'🔒'; background: rgba(255, 215, 0, 0.18); }
.cell.crate::before { content:'📦'; background: rgba(160, 115, 65, 0.18); }
.cell.chain::before { content:'⛓️'; background: rgba(111, 120, 138, 0.18); }
.cell.stone::before { content:'🪨'; background: rgba(120, 120, 120, 0.22); }
.cell.ice::after {
    content: '❄️'; position: absolute; inset: 0; display:flex; align-items:center; justify-content:center;
    font-size: 18px; background: rgba(173, 216, 230, 0.28); border-radius: 6px;
}
.cell.ice2::after { background: rgba(135, 206, 250, 0.4); }
@keyframes hintPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.buttons, .shop-buttons { display:flex; gap:10px; }
button {
    flex:1; padding:12px; border:none; border-radius:8px; font-size:14px; font-weight:bold; cursor:pointer;
}
.btn-primary { background:#667eea; color:white; }
.btn-secondary { background:#eee; }
.btn-secondary:disabled, .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.panel {
    background:#f8f8fb; border:1px solid #ececf6; border-radius:12px; padding:12px; margin-bottom:14px;
}
.panel-title { font-size:13px; font-weight:bold; color:#666; margin-bottom:8px; }
.panel.compact-panel { padding:9px 12px; margin-bottom:10px; }
.compact-panel .panel-title { margin-bottom:4px; }
.compact-panel .compact-text { font-size:12px; color:#666; line-height:1.35; }
.shop-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.shop-item {
    background:white; border:1px solid #ececf6; border-radius:10px; padding:10px;
}
.shop-item strong { display:block; font-size:13px; margin-bottom:4px; }
.shop-item span { display:block; font-size:12px; color:#777; margin-bottom:8px; }
.shop-item button { width:100%; padding:10px; font-size:12px; }
.message {
    padding:10px; border-radius:8px; margin-bottom:15px; text-align:center; font-weight:bold; display:none;
}
.message.show { display:block; }
.message.error { background:#f8d7da; color:#721c24; }
.message.success { background:#d4edda; color:#155724; }
.modal, .overlay {
    display:none; position:fixed; inset:0; background:rgba(0,0,0,0.7); align-items:center; justify-content:center; z-index:1000;
}
.modal.show, .overlay.show { display:flex; }
.modal-content {
    background:white; padding:28px; border-radius:20px; text-align:center; max-width:360px; width:90%;
}
.modal-title { font-size:28px; font-weight:bold; margin-bottom:10px; }
.modal-message { color:#666; margin-bottom:20px; }
.modal-stats {
    display:flex; justify-content:space-around; padding:15px; background:#f5f5f5; border-radius:10px; margin-bottom:20px;
}
.menu-card {
    background:white; width:min(92vw, 390px); max-height:90vh; overflow-y:auto; border-radius:22px; padding:22px; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,0.35);
}
.menu-card h1 { font-size:30px; margin-bottom:8px; }
.menu-card p { color:#666; font-size:14px; line-height:1.5; margin-bottom:16px; }
.badges { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-bottom:16px; }
.badge { background:#f2f4ff; color:#4f5fd0; border-radius:999px; padding:6px 10px; font-size:12px; font-weight:bold; }
.footer-note { color:#888; font-size:12px; margin-top:10px; }
.menu-grid-note { font-size:12px; color:#666; margin-top:8px; }
.panel.compact { padding:12px; }
#levelSelect:empty::before, #levelMap:empty::before { content:'Yükleniyor...'; color:#999; font-size:13px; }
.level-select { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; margin-top:14px; }
.level-btn { padding:10px 0; border:none; border-radius:12px; background:#eef1ff; color:#4452b8; font-weight:bold; cursor:pointer; }
.level-btn.locked { background:#f1f1f1; color:#aaa; cursor:not-allowed; }
.achievements-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.achievement-item { background:white; border:1px solid #ececf6; border-radius:10px; padding:10px; font-size:12px; color:#666; }
.achievement-item.unlocked { background:#eefbf1; border-color:#bfe7c6; color:#276738; }
.daily-row { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.map-panel { margin-top:14px; padding:14px; background:linear-gradient(180deg,#f7f9ff,#eef2ff); border-radius:18px; border:1px solid #dfe5ff; }
.map-title { font-size:13px; font-weight:bold; color:#5a67d8; margin-bottom:10px; text-align:left; }
.level-map { position:relative; display:grid; grid-template-columns:repeat(3,1fr); gap:14px 18px; padding:8px 6px 2px; }
.level-map::before { content:''; position:absolute; left:16%; right:16%; top:16px; bottom:16px; background:linear-gradient(180deg,rgba(102,126,234,.18),rgba(118,75,162,.12)); border-radius:999px; filter:blur(10px); z-index:0; }
.map-node { position:relative; z-index:1; width:64px; height:64px; margin:0 auto; border:none; border-radius:50%; font-weight:bold; font-size:16px; cursor:pointer; box-shadow:0 10px 20px rgba(79,95,208,.15); transition:transform .2s, box-shadow .2s; }
.map-node:hover { transform:translateY(-2px) scale(1.03); box-shadow:0 14px 24px rgba(79,95,208,.2); }
.map-node.open { background:linear-gradient(135deg,#8ea2ff,#667eea); color:#fff; }
.map-node.current { outline:4px solid rgba(255,193,7,.55); }
.map-node.done { background:linear-gradient(135deg,#67d59d,#32b56c); color:#fff; }
.map-node.locked { background:#ececec; color:#aaa; cursor:not-allowed; box-shadow:none; }
.map-node.star::after { content:'⭐'; position:absolute; top:-8px; right:-4px; font-size:16px; }
.cell.spawn { animation: tileDrop .28s ease-out; }
.cell.match-burst { animation: burst .28s ease-out; }
.score-pop { position:fixed; z-index:1200; pointer-events:none; font-weight:bold; color:#4f5fd0; animation: floatUp .9s ease-out forwards; }
@keyframes tileDrop { 0% { transform:translateY(-12px) scale(.92); opacity:.25; } 100% { transform:translateY(0) scale(1); opacity:1; } }
@keyframes burst { 0% { transform:scale(1); opacity:1; } 60% { transform:scale(1.18); opacity:.95; } 100% { transform:scale(.55); opacity:0; } }
@keyframes floatUp { 0% { transform:translateY(0); opacity:0; } 15% { opacity:1; } 100% { transform:translateY(-28px); opacity:0; } }

.level-transition {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(25, 22, 56, 0.35);
    backdrop-filter: blur(3px);
    z-index: 1200;
    pointer-events: none;
}
.level-transition.show { display: flex; }
.level-transition-card {
    min-width: 280px;
    max-width: 88vw;
    background: linear-gradient(135deg, #ffffff, #f6f1ff);
    border-radius: 24px;
    padding: 24px 22px;
    text-align: center;
    box-shadow: 0 22px 60px rgba(0,0,0,.22);
    animation: levelCardPop .7s ease;
}
.level-transition-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef1ff;
    color: #5a67d8;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
}
.level-transition-title {
    font-size: 28px;
    font-weight: bold;
    color: #3d2e7c;
    margin-bottom: 8px;
}
.level-transition-text {
    color: #6b6b7d;
    font-size: 15px;
}
@keyframes levelCardPop {
    0% { transform: scale(.85) translateY(16px); opacity: 0; }
    60% { transform: scale(1.04) translateY(0); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}


.howto-note {
    font-size: 14px;
    color: #5f6368;
    line-height: 1.6;
    margin-bottom: 18px;
}
.howto-list {
    text-align: left;
    background: #f7f8ff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.howto-list div {
    margin-bottom: 8px;
    color: #444;
    font-size: 14px;
}
.howto-list div:last-child { margin-bottom: 0; }
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}
.checkbox-row input { width: 18px; height: 18px; }