:root {
  --ink: #1d1b2f;
  --panel: rgba(255, 255, 255, 0.94);
  --accent: #ff4f6d;
  --accent-dark: #d93653;
  --gold: #ffc531;
  --muted: #6b6880;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #1d1b2f; font-family: "Baloo 2", system-ui, sans-serif; color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
canvas#game { display: block; position: fixed; inset: 0; }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 16px; pointer-events: none; z-index: 5; }
.pill { background: rgba(29, 27, 47, 0.62); color: #fff; border-radius: 999px; padding: 4px 16px; font-weight: 800; font-size: 22px; line-height: 1.3; backdrop-filter: blur(4px); }
#hudLeft, #hudRight { display: flex; flex-direction: column; gap: 8px; }
#hudRight { align-items: flex-end; }
#coinPill { color: var(--gold); }
#powers { display: flex; flex-direction: column; gap: 6px; }
.power { background: rgba(29, 27, 47, 0.62); color: #fff; border-radius: 12px; padding: 3px 10px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.power .bar { width: 60px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.25); overflow: hidden; }
.power .bar i { display: block; height: 100%; background: var(--gold); }
.roundBtn { pointer-events: auto; border: 0; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; background: rgba(29, 27, 47, 0.62); color: #fff; font-size: 18px; font-weight: 800; }

#bubble { position: fixed; left: 50%; top: 22%; transform: translate(-50%, 10px) scale(0.9); background: #fff; color: var(--ink); font-weight: 800; font-size: 22px; padding: 8px 18px; border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 30; white-space: nowrap; }
#bubble::after { content: ''; position: absolute; left: 50%; bottom: -10px; margin-left: -10px; border: 10px solid transparent; border-bottom: 0; border-top-color: #fff; }
#bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; background: rgba(29, 27, 47, 0.35); }
.overlay.hidden { display: none; }
.card { background: var(--panel); border-radius: 24px; padding: 24px; width: min(500px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.35); text-align: center; touch-action: pan-y; }
h1 { font-size: 40px; line-height: 1; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
h2 { font-size: 32px; font-weight: 800; color: var(--accent); }
.sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.pickTitle { font-weight: 800; font-size: 17px; margin-top: 12px; }
.chars { display: flex; gap: 10px; justify-content: center; margin: 8px 0 4px; }
.charCard { border: 3px solid transparent; border-radius: 18px; background: #f2f1f7; padding: 6px 6px 4px; cursor: pointer; flex: 1 1 0; min-width: 0; max-width: 150px; font-family: inherit; color: var(--ink); transition: transform 0.15s, background 0.15s; }
.charCard:hover { transform: translateY(-2px); }
.charCard.sel { border-color: var(--accent); background: #fff0f3; }
.charCard canvas { width: 100%; height: auto; aspect-ratio: 260 / 340; display: block; margin: 0 auto; }
.charCard .nm { font-weight: 800; font-size: 20px; }
.charCard.sel .nm { color: var(--accent); }
.row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
button.btn, label.btn { border: 0; cursor: pointer; border-radius: 14px; padding: 10px 18px; font-family: inherit; font-weight: 700; font-size: 16px; background: #ecebf3; color: var(--ink); display: inline-block; }
button.btn:hover, label.btn:hover { background: #e0dfea; }
button.primary { background: var(--accent); color: #fff; font-size: 22px; padding: 12px 36px; box-shadow: 0 6px 0 var(--accent-dark); margin-top: 10px; }
button.primary:hover { background: #ff6680; }
button.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--accent-dark); }
input[type=file] { display: none; }
.sliders { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; text-align: left; font-size: 14px; color: var(--muted); margin: 6px 4px; }
.sliders input { width: 100%; accent-color: var(--accent); }
details { margin-top: 6px; text-align: left; }
summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 15px; text-align: center; }
.help { font-size: 14px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.help b { color: var(--ink); }
#imgStatus { font-size: 13px; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }
.stat { background: #f2f1f7; border-radius: 14px; padding: 8px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 800; }
.newbest { color: var(--accent); font-weight: 800; font-size: 18px; }

/* ---------- Oyunlar ekranı ---------- */
.card { position: relative; }
.backBtn { position: absolute; left: 14px; top: 14px; padding: 6px 12px; font-size: 14px; }
#menu h1 { margin-top: 38px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
.gameTile { border: 0; cursor: pointer; border-radius: 18px; padding: 14px 10px; font-family: inherit; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 6px 0 rgba(0,0,0,0.18); transition: transform 0.15s; }
.gameTile:hover { transform: translateY(-3px); }
.gameTile:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.18); }
#goRun { background: linear-gradient(135deg, #ff6b6b, #ff4f6d); }
#goDress { background: linear-gradient(135deg, #c77dff, #ff7eb6); }
.gameTile .gi { font-size: 40px; line-height: 1.1; }
.gameTile b { font-size: 19px; font-weight: 800; }
.gameTile small { font-size: 13px; opacity: 0.92; }
.row .btn + .btn { margin-left: 0; }

/* ---------- Moda stüdyosu ---------- */
.screen { position: fixed; inset: 0; z-index: 12; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; background: linear-gradient(160deg, #ffe3f1, #e9dcff); }
.screen.hidden { display: none; }
.dressTop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dressTop h2 { flex: 1; font-size: 28px; color: #b5179e; }
.miniChars { display: flex; gap: 6px; }
.mc { border: 3px solid transparent; background: #fff; border-radius: 999px; padding: 4px 14px; font-family: inherit; font-weight: 800; font-size: 16px; cursor: pointer; color: var(--ink); }
.mc.sel { border-color: var(--accent); color: var(--accent); }
.dressBody { flex: 1; display: flex; gap: 16px; min-height: 0; }
.stage { flex: 1.15; min-width: 0; border-radius: 24px; overflow: hidden; box-shadow: 0 10px 30px rgba(120, 60, 160, 0.2); }
.stage canvas { width: 100%; height: 100%; display: block; }
.panel { flex: 1; max-width: 460px; overflow-y: auto; background: #fff; border-radius: 24px; padding: 16px; box-shadow: 0 10px 30px rgba(120, 60, 160, 0.15); touch-action: pan-y; }
.secT { font-weight: 800; font-size: 17px; margin: 6px 0 8px; }
.secT:not(:first-child) { margin-top: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.opt { border: 3px solid transparent; background: #f5f2fb; border-radius: 14px; padding: 8px 4px 6px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 13px; color: var(--ink); line-height: 1.15; transition: transform 0.12s; }
.opt:hover { transform: translateY(-2px); }
.opt .oi { font-size: 30px; display: block; margin-bottom: 2px; }
.opt.sel { border-color: var(--accent); background: #fff0f3; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sw i { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #e2dff0; display: block; }
.sw.sel i { box-shadow: 0 0 0 3px var(--accent); }
.sw.sel { color: var(--accent); }
.tools { margin-top: 16px; }
#dressRun { width: 100%; margin-top: 6px; font-size: 20px; }
@media (max-width: 760px) {
  .dressBody { flex-direction: column; gap: 10px; }
  .stage { flex: 0 0 40vh; }
  .panel { max-width: none; flex: 1; }
  .dressTop h2 { font-size: 22px; }
}

/* ---------- Cüzdan, görevler, dünyalar, dükkan ---------- */
.walletRow { display: flex; gap: 8px; justify-content: center; margin: 8px 0 2px; flex-wrap: wrap; }
.walletPill { background: #fff4d1; color: #8a5a00; border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.themes { justify-content: center; flex-wrap: wrap; }
#menu .secT { text-align: left; }
#missionList { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.mission { background: #f5f2fb; border-radius: 12px; padding: 6px 10px; }
.mtop { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.mrew { color: #8a5a00; white-space: nowrap; }
.mbar { height: 6px; background: #e4def3; border-radius: 3px; overflow: hidden; margin-top: 4px; }
.mbar i { display: block; height: 100%; background: linear-gradient(90deg, #ff7eb6, #ffc531); }
.mprog { font-size: 12px; color: var(--muted); text-align: right; }
.opt, .sw { position: relative; }
.opt.locked, .sw.locked { opacity: 0.75; }
.opt.locked .oi, .sw.locked i { filter: grayscale(0.7); }
.lock { display: block; font-size: 11px; font-weight: 800; color: #8a5a00; margin-top: 2px; }
.opt.confirm, .sw.confirm { opacity: 1; outline: 3px dashed #ffc531; }
.opt.confirm .oi, .sw.confirm i { filter: none; }
