:root {
  --bg: #ffffff;
  --text: #1e293b;
  --btn-bg: #f1f5f9;
  --btn-text: #334155;
  --dot: transparent; /* No dots at all */
  --arrow: #0f172a; /* Deep dark blue */
  --arrow-err: #ef4444;
  --modal-bg: #ffffff;
  --modal-border: #e2e8f0;
  --accent1: #6366f1;
  --accent2: #4f46e5;
  --badge-bg: #e0e7ff;
  --badge-text: #4f46e5;
  --box-bg: #f8fafc;
  --shadow: rgba(0,0,0,0.06);
}

body.dark {
  --bg: #0f172a;
  --text: #f8fafc;
  --btn-bg: #1e293b;
  --btn-text: #94a3b8;
  --dot: #334155;
  --arrow: #38bdf8;
  --arrow-err: #f87171;
  --modal-bg: #1e293b;
  --modal-border: #334155;
  --badge-bg: #3730a3;
  --badge-text: #e0e7ff;
  --box-bg: #0f172a;
  --shadow: rgba(0,0,0,0.5);
}

* { margin:0; padding:0; box-sizing:border-box; font-family:'Outfit',sans-serif; }
body { background:var(--bg); color:var(--text); display:flex; justify-content:center; min-height:100vh; overflow-x:hidden; overflow-y:auto; transition: background 0.3s, color 0.3s; }
.app { width:100%; max-width:700px; display:flex; flex-direction:column; min-height:100vh; }

.top-bar { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; }
.top-left { display:flex; gap:12px; }
.circle-btn { width:42px; height:42px; border-radius:50%; border:none; background:var(--btn-bg); color:var(--btn-text); font-size:1.1rem; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px var(--shadow); transition:transform .15s, background .3s, color .3s; }
.circle-btn:hover { transform:scale(1.08); }

.stats { display:flex; gap:12px; font-weight:600; font-size:1.1rem; color: #f59e0b; }
.hearts { display:flex; gap:4px; font-size:1.3rem; }
.heart.lost { filter:grayscale(1) opacity(.3); transition:filter .3s; }

.progress-bar { height:4px; background:var(--btn-bg); margin:0 16px; border-radius:2px; overflow:hidden; }
.progress-fill { height:100%; width:0%; background:linear-gradient(90deg,var(--accent1),var(--accent2)); border-radius:2px; transition:width .4s ease; }

.level-badge-container { text-align:center; padding:12px; }
.level-badge { display:inline-block; padding:4px 16px; border-radius:12px; background:var(--badge-bg); color:var(--badge-text); font-size:0.9rem; font-weight:700; letter-spacing:1px; }

.game-area { flex:1; display:flex; justify-content:center; align-items:center; overflow:visible; padding:8px 0; }
canvas { touch-action:none; cursor:pointer; display:block; max-width:100%; height:auto; }

.overlay { position:fixed; inset:0; background:rgba(0,0,0,.6); display:flex; justify-content:center; align-items:center; z-index:100; transition:opacity .3s; backdrop-filter: blur(4px); }
.overlay.hidden { opacity:0; pointer-events:none; }

.modal { background:var(--modal-bg); padding:36px; border-radius:24px; text-align:center; box-shadow:0 20px 60px var(--shadow); border:1px solid var(--modal-border); min-width:300px; transition: background .3s, border .3s; }
.modal h2 { color:var(--accent1); margin-bottom:4px; font-size:1.6rem; }
.motive-text { color:#10b981; font-weight:700; font-size:1.2rem; margin-bottom:24px; }

.district-info-box { background:var(--box-bg); padding:16px; border-radius:16px; margin-bottom:24px; border: 1px solid var(--modal-border); }
.district-name { font-size:1.3rem; font-weight:700; color:var(--accent2); margin-bottom:4px; }
.district-info { font-size:0.9rem; color:var(--text); opacity: 0.8; }

.action-btn { display:block; width:100%; padding:14px; border:none; border-radius:14px; font-size:1.05rem; font-weight:600; cursor:pointer; margin-bottom:10px; background:linear-gradient(135deg,var(--accent1),var(--accent2)); color:#fff; transition:transform .15s; }
.action-btn:hover { transform:scale(1.03); }
.action-btn.secondary { background:var(--btn-bg); color:var(--btn-text); }

/* Settings Modal UI */
.setting-row { display:flex; justify-content:space-between; align-items:center; padding:12px 4px; margin-bottom:8px; border-bottom: 1px solid var(--modal-border); color:var(--text); font-weight:600; }
.setting-row:last-of-type { border-bottom: none; margin-bottom: 24px; }
.styled-select { padding: 6px 12px; background:var(--btn-bg); color:var(--text); border:none; border-radius:8px; font-size:0.9rem; font-family:'Outfit',sans-serif; cursor:pointer; outline: none;}

/* Switch Toggle Code */
.switch { position: relative; display: inline-block; width: 44px; height: 24px;}
.switch input { opacity: 0; width: 0; height: 0;}
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px;}
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%;}
input:checked + .slider { background-color: var(--accent1);}
input:checked + .slider:before { transform: translateX(20px);}

@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.shake { animation:shake .15s ease-in-out 2; }
