:root{
  --bg:#0f1226;
  --card:#171a36;
  --accent:#ff6ac1;
  --accent-2:#6ad7ff;
  --text:#e9ecff;
  --muted:#9aa3c7;
  --ok:#48e0a4;
  --warning:#ffd166;
  --danger:#ff5d5d;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text); background:radial-gradient(1200px 600px at 15% -10%, #1b1f46 0%, #0f1226 45%, #0b0e1f 100%);
  line-height:1.5; overflow-x:hidden;
}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline}

/* Header - Mobil Uyumlu */
header{
  position:sticky; top:0; z-index:50; backdrop-filter:saturate(140%) blur(8px);
  background:linear-gradient(180deg, rgba(15,18,38,.85), rgba(15,18,38,.55));
  border-bottom:1px solid rgba(255,255,255,.06);
}
.nav{
  max-width:1100px; margin:auto; display:flex; align-items:center; justify-content:space-between; 
  padding:14px 20px; flex-wrap:wrap; gap:12px;
}
.brand{
  display:flex; align-items:center; gap:12px; font-weight:800; letter-spacing:.3px;
  font-size:18px;
}
.logo{
  width:36px; height:36px; background:conic-gradient(from 0deg, var(--accent), #ffd1f0, var(--accent-2), #a4ffea, var(--accent)); 
  border-radius:10px; box-shadow:0 6px 20px rgba(255,106,193,.35), inset 0 0 14px rgba(255,255,255,.35);
  flex-shrink:0;
}
nav ul{display:flex; gap:12px; list-style:none; padding:0; margin:0; flex-wrap:wrap}
nav a{color:var(--text); font-weight:600; padding:8px 12px; border-radius:10px; font-size:14px}
nav a:hover{background:rgba(255,255,255,.06)}

/* Hero Section - Mobil Uyumlu */
.hero{
  max-width:1100px; margin:24px auto 0; padding:20px; 
  display:grid; grid-template-columns:1fr; gap:20px; align-items:center;
}
.hero-card{
  background:linear-gradient(180deg, rgba(23,26,54,.85), rgba(23,26,54,.55));
  border:1px solid rgba(255,255,255,.06); border-radius:22px; padding:24px; 
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.hero h1{font-size:28px; line-height:1.2; margin:0 0 10px}
.hero p{color:var(--muted); font-size:16px; margin:10px 0 18px}
.cta{display:flex; gap:10px; flex-wrap:wrap}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 16px; border-radius:14px; border:1px solid rgba(255,255,255,.1);
  background:linear-gradient(180deg, #2a2f69, #1e2351);
  color:var(--text); font-weight:700; cursor:pointer; transition:.2s transform, .2s filter, .2s background;
  text-align:center; font-size:14px; min-width:120px;
}
.btn:hover{transform:translateY(-1px); filter:brightness(1.05)}
.btn-primary{background:linear-gradient(180deg, var(--accent), #ff3fae)}
.btn-ghost{background:transparent}

.caps{font-size:11px; letter-spacing:.2em; text-transform:uppercase; color:#b9c1e6}

/* Game section - Mobil Uyumlu */
#play{
  max-width:1100px; margin:10px auto 50px; padding:0 20px; 
  display:grid; grid-template-columns:1fr; gap:20px;
}
.board-wrap{
  background:linear-gradient(180deg, rgba(23,26,54,.85), rgba(23,26,54,.55)); 
  padding:16px; border-radius:22px; border:1px solid rgba(255,255,255,.06);
}
.board-controls{
  display:flex; align-items:center; justify-content:space-between; 
  margin-bottom:14px; flex-wrap:wrap; gap:10px;
}
.board-controls > div:first-child{
  min-width:200px;
}
.board-controls .caps{display:block; margin-bottom:4px}
.board-controls .note{font-size:12px; color:var(--muted)}
.board-controls .button-group{
  display:flex; gap:8px; flex-wrap:wrap;
}

#board{
  display:grid; gap:6px; --size:8; 
  grid-template-columns:repeat(var(--size), 1fr); 
  justify-content:center; max-width:100%; margin:0 auto;
}
.cell{
  aspect-ratio:1; border-radius:12px; display:grid; place-items:center; 
  cursor:pointer; position:relative; min-height:44px;
}
.candy{
  width:90%; height:90%; border-radius:12px; 
  box-shadow: inset 0 4px 12px rgba(255,255,255,.35), 0 4px 12px rgba(0,0,0,.35); 
  border:1px solid rgba(255,255,255,.18);
}
.c0{background: radial-gradient(circle at 30% 25%, #ffd9f2, #ff6ac1)}
.c1{background: radial-gradient(circle at 30% 25%, #d6f5ff, #00b7ff)}
.c2{background: radial-gradient(circle at 30% 25%, #ffe6c1, #ff9800)}
.c3{background: radial-gradient(circle at 30% 25%, #e0ffd8, #3bd671)}
.c4{background: radial-gradient(circle at 30% 25%, #e6e1ff, #7b61ff)}
.c5{background: radial-gradient(circle at 30% 25%, #fff0d6, #ffd166)}

.selected{outline:2px solid var(--warning); outline-offset:2px}
.clearing{animation:puff .25s ease forwards}
@keyframes puff{to{transform:scale(.6); opacity:.25}}

.panel{
  background:linear-gradient(180deg, rgba(23,26,54,.85), rgba(23,26,54,.55)); 
  padding:18px; border-radius:22px; border:1px solid rgba(255,255,255,.06); 
  height:max-content;
}
.stat{
  display:flex; align-items:center; justify-content:space-between; 
  padding:10px 12px; border-radius:12px; background:rgba(255,255,255,.04); 
  margin-bottom:10px;
}
.big{font-size:24px; font-weight:800}
.note{font-size:13px; color:var(--muted)}
.badge{
  display:inline-block; padding:6px 10px; font-size:12px; border-radius:999px; 
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.08);
}

/* About */
#about{max-width:1100px; margin:0 auto 80px; padding:0 20px}
.card{
  background:linear-gradient(180deg, rgba(23,26,54,.85), rgba(23,26,54,.55)); 
  padding:22px; border-radius:22px; border:1px solid rgba(255,255,255,.06);
}

/* Footer */
footer{border-top:1px solid rgba(255,255,255,.06); background:rgba(15,18,38,.7)}
.footer{
  max-width:1100px; margin:0 auto; padding:20px; display:flex; 
  flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between;
}
.footer a{color:#cbd3ff}

/* Modal System - Popup için */
.modal-backdrop{
  position:fixed; top:0; left:0; right:0; bottom:0; 
  background:rgba(0,0,0,.7); z-index:100; display:none;
  backdrop-filter:blur(4px);
}
.modal{
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(500px, 90vw); z-index:101; display:none;
}
.modal-content{
  background:linear-gradient(180deg, rgba(23,26,54,.95), rgba(23,26,54,.85));
  border:1px solid rgba(255,255,255,.1); border-radius:20px; padding:24px;
  box-shadow:0 20px 60px rgba(0,0,0,.5); max-height:80vh; overflow-y:auto;
}
.modal-header{
  display:flex; justify-content:space-between; align-items:center; 
  margin-bottom:16px; gap:10px;
}
.modal-title{margin:0; font-size:20px; color:var(--text)}
.modal-close{
  background:transparent; border:1px solid rgba(255,255,255,.2); 
  color:var(--text); padding:8px 12px; border-radius:8px; cursor:pointer;
  font-size:14px;
}
.modal-close:hover{background:rgba(255,255,255,.1)}
.modal-body{color:var(--muted); line-height:1.6}

/* Tablet Portrait */
@media (min-width: 768px){
  .hero{grid-template-columns:1.2fr .8fr; padding:46px 20px 30px}
  .hero h1{font-size:36px}
  .hero p{font-size:18px}
  #play{grid-template-columns:1fr 300px}
  .board-controls{flex-wrap:nowrap}
  #board{gap:8px}
  .cell{min-height:52px}
  .big{font-size:28px}
}

/* Desktop */
@media (min-width: 1024px){
  .hero h1{font-size:40px}
  #play{grid-template-columns:1fr 350px}
  .cell{min-height:56px}
  #board{grid-template-columns:repeat(var(--size), 56px)}
  .candy{width:52px; height:52px}
}

/* Large screens */
@media (min-width: 1200px){
  .nav{padding:14px 40px}
  .hero{padding:46px 40px 30px}
  #play{padding:0 40px}
  #about{padding:0 40px}
  .footer{padding:20px 40px}
}

/* Mobile specific adjustments */
@media (max-width: 767px){
  .nav{padding:12px 16px}
  .brand{font-size:16px}
  .logo{width:32px; height:32px}
  nav ul{gap:8px}
  nav a{padding:6px 10px; font-size:13px}
  
  .hero{padding:20px 16px; gap:16px}
  .hero-card{padding:20px}
  .hero h1{font-size:24px; line-height:1.3}
  .hero p{font-size:15px}
  
  #play{padding:0 16px; gap:16px}
  .board-wrap{padding:14px}
  .board-controls{margin-bottom:10px}
  .board-controls .caps{font-size:10px}
  .board-controls .note{font-size:11px}
  .btn{padding:10px 14px; font-size:13px; min-width:100px}
  
  .panel{padding:16px}
  .stat{padding:8px 10px}
  .big{font-size:20px}
  .note{font-size:12px}
  
  #about{padding:0 16px}
  .card{padding:18px}
  
  .footer{padding:16px; flex-direction:column; text-align:center}
  .footer > div{display:flex; flex-wrap:wrap; gap:8px; justify-content:center}
  
  .modal{width:min(400px, 95vw)}
  .modal-content{padding:20px; max-height:85vh}
  .modal-title{font-size:18px}
}

/* Extra small screens */
@media (max-width: 480px){
  .hero h1{font-size:22px}
  .btn{min-width:80px; padding:8px 12px}
  .cta{gap:8px}
  #board{gap:4px}
  .cell{min-height:38px}
  .modal{width:95vw}
  .modal-content{padding:16px}
}

/* Modal System */
.x46745-modal-backdrop{
  position:fixed; top:0; left:0; right:0; bottom:0; 
  background:rgba(0,0,0,.7); z-index:100; display:none;
  backdrop-filter:blur(4px);
}
.x46745-modal{
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(500px, 90vw); z-index:101; display:none;
}
.x46745-modal-content{
  background:linear-gradient(180deg, rgba(23,26,54,.95), rgba(23,26,54,.85));
  border:1px solid rgba(255,255,255,.1); border-radius:20px; padding:24px;
  box-shadow:0 20px 60px rgba(0,0,0,.5); max-height:80vh; overflow-y:auto;
}
.x46745-modal-header{
  display:flex; justify-content:space-between; align-items:center; 
  margin-bottom:16px; gap:10px;
}
.x46745-modal-title{margin:0; font-size:20px; color:#e9ecff}
.x46745-modal-close{
  background:transparent; border:1px solid rgba(255,255,255,.2); 
  color:#e9ecff; padding:8px 12px; border-radius:8px; cursor:pointer;
  font-size:14px;
}
.x46745-modal-close:hover{background:rgba(255,255,255,.1)}
.x46745-modal-body{color:#9aa3c7; line-height:1.6; text-align:center}

/* Welcome Modal Styles */
.x46745-welcome-modal .x46745-modal-content {
  text-align: center;
  max-width: 600px;
}
.x46745-welcome-modal .x46745-modal-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 16px;
  margin: -10px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.x46745-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 16px; border-radius:14px; border:1px solid rgba(255,255,255,.1);
  background:linear-gradient(180deg, #2a2f69, #1e2351);
  color:#e9ecff; font-weight:700; cursor:pointer; transition:.2s transform, .2s filter, .2s background;
  text-align:center; font-size:14px; min-width:120px; text-decoration:none;
}
.x46745-btn:hover{transform:translateY(-1px); filter:brightness(1.05)}
.x46745-btn-success{background:linear-gradient(180deg, #48e0a4, #2bb36e); color:white; width: 95%;}
.x46745-btn-ghost{background:transparent}

/* Mobile Responsive */
@media (max-width: 767px){
  .x46745-modal{width:min(400px, 95vw)}
  .x46745-modal-content{padding:20px; max-height:85vh}
  .x46745-modal-title{font-size:18px}
  .x46745-btn{padding:10px 14px; font-size:13px; min-width:100px}
}

@media (max-width: 480px){
  .x46745-modal{width:95vw}
  .x46745-modal-content{padding:16px}
  .x46745-btn{min-width:80px; padding:8px 12px}
}