:root {
  --ink:    #0a0805;
  --wood:   #1a0f05;
  --plank:  #261505;
  --amber:  #e8920a;
  --gold:   #f5c842;
  --cream:  #f0e6c8;
  --splash: #5bc8f0;
  --red:    #c0392b;
  --r:      12px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

body {
  background: var(--ink);
  font-family: 'Nunito', sans-serif;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  cursor: url("../assets/images/cursor-fishing.svg") 4 24, auto;
}

/* wood grain overlay */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(91deg, transparent 0, transparent 22px, rgba(0,0,0,.03) 22px, rgba(0,0,0,.03) 23px),
    repeating-linear-gradient(180deg, transparent 0, transparent 60px, rgba(255,255,255,.01) 60px, rgba(255,255,255,.01) 61px);
}

/* ---- NAV ---- */
nav {
  position: relative; z-index: 50;
  background: rgba(10,8,5,.97);
  border-bottom: 2px solid rgba(245,200,66,.25);
  padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; flex-shrink: 0;
  box-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.nav-logo {
  font-family: 'Cabin Sketch', cursive;
  font-size: 20px; color: var(--gold);
  text-shadow: 0 0 14px rgba(245,200,66,.5);
  text-decoration: none; white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-link {
  color: rgba(240,230,200,.5); font-size: 12px; font-weight: 700;
  text-decoration: none; padding: 5px 10px; border-radius: 6px; transition: all .2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--gold); background: rgba(245,200,66,.1); }
.nav-link.active { color: var(--gold); background: rgba(245,200,66,.12); }

/* LANG */
.lang-wrap { position: relative; }
#langBtn {
  background: rgba(245,200,66,.1); border: 1px solid rgba(245,200,66,.3);
  border-radius: 8px; padding: 4px 9px; color: var(--gold);
  font-family: 'Nunito', sans-serif; font-size: 11px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
#langBtn:hover { background: rgba(245,200,66,.2); }
#langDropdown {
  position: absolute; right: 0; top: calc(100% + 5px);
  background: #1a0f05; border: 1px solid rgba(245,200,66,.25); border-radius: 10px;
  padding: 5px; min-width: 170px; max-height: 300px; overflow-y: auto;
  display: none; z-index: 200; box-shadow: 0 12px 40px rgba(0,0,0,.8);
}
#langDropdown.open { display: block; }
#langDropdown::-webkit-scrollbar { width: 4px; }
#langDropdown::-webkit-scrollbar-thumb { background: rgba(245,200,66,.3); border-radius: 2px; }
.lang-opt {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: rgba(240,230,200,.7); transition: all .15s;
}
.lang-opt:hover { background: rgba(245,200,66,.12); color: var(--gold); }
.lang-opt.selected { background: rgba(245,200,66,.15); color: var(--gold); }

/* ---- MAIN GAME AREA ---- */
#gameShell {
  flex: 1; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 12px 10px;
  overflow: hidden;
  gap: 7px;
}

/* sunset bg behind game */
#gameBg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg,
    #0d0618 0%, #3d0e20 12%, #a0280f 25%,
    #cc5500 36%, #e88800 46%,
    #1565c0 56%, #06182e 72%, #061524 100%);
}
#gameBgWater {
  position: absolute; bottom: 0; left: 0; right: 0; height: 38%; z-index: 1;
  background: linear-gradient(180deg, rgba(13,58,106,.65) 0%, rgba(4,14,32,.98) 100%);
  overflow: hidden;
}
#gameBgWater::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 10px, rgba(91,200,240,.04) 10px, rgba(91,200,240,.04) 11px);
  animation: wv 3.5s linear infinite;
}
@keyframes wv { to { transform: translateY(11px); } }
.sun-pillar {
  position: absolute; bottom: 37%; left: 50%; transform: translateX(-50%);
  width: 6px; height: 200px; z-index: 2;
  background: linear-gradient(180deg, rgba(255,200,50,.5), transparent);
  filter: blur(8px);
  animation: sp 5s ease-in-out infinite alternate;
}
@keyframes sp { from { width: 6px; opacity: .5; } to { width: 22px; opacity: .2; } }

/* silhouette trees */
.trees {
  position: absolute; bottom: 36%; left: 0; right: 0; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; padding: 0 3%;
  pointer-events: none;
}
.tree {
  width: 0; height: 0;
  border-left: solid transparent; border-right: solid transparent; border-bottom: solid #0a0413;
}
.stars-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.sb { position: absolute; background: #fff; border-radius: 50%; animation: bk var(--d,3s) ease-in-out infinite; }
@keyframes bk { 0%,100%{opacity:.05} 50%{opacity:.8} }

/* ---- BONUS BANNER ---- */
#bonusBanner {
  position: relative; z-index: 10;
  width: 100%; max-width: 900px;
  background: linear-gradient(90deg, rgba(232,146,10,.12), rgba(245,200,66,.2), rgba(232,146,10,.12));
  border: 1.5px solid rgba(245,200,66,.5);
  border-radius: 10px; padding: 4px 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  animation: bp 2.5s ease-in-out infinite;
}
@keyframes bp { 0%,100%{box-shadow:0 0 6px rgba(245,200,66,.2)} 50%{box-shadow:0 0 18px rgba(245,200,66,.6)} }
.bl { font-size: 11px; color: var(--gold); font-weight: 900; white-space: nowrap; }
.btags { display: flex; gap: 6px; flex-wrap: wrap; }
.btag {
  background: rgba(245,200,66,.12); border: 1px solid rgba(245,200,66,.35);
  border-radius: 5px; padding: 1px 8px; font-size: 10px; color: #ffe082; white-space: nowrap;
}

/* ---- HUD ---- */
#hud {
  position: relative; z-index: 10;
  width: 100%; max-width: 900px;
  background: rgba(5,10,20,.9);
  border: 2px solid rgba(245,200,66,.35);
  border-radius: 12px; padding: 5px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 20px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.hud-title {
  font-family: 'Cabin Sketch', cursive; font-size: 20px; color: var(--gold);
  text-shadow: 0 0 14px rgba(245,200,66,.6), 2px 2px 0 #3e1a00;
  white-space: nowrap;
}
.hud-title span { color: var(--splash); }
.hud-stats { display: flex; gap: 6px; }
.stat {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,.04); border: 1px solid rgba(245,200,66,.2);
  border-radius: 8px; padding: 2px 10px; min-width: 60px;
}
.stat-l { font-size: 9px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; }
.stat-v { font-family: 'Cabin Sketch', cursive; font-size: 17px; color: var(--gold); line-height: 1.1; }
#livesVal { color: #ef5350; }

/* FISH PROGRESS BAR */
.fish-bar-wrap {
  display: flex; align-items: center; gap: 8px; min-width: 120px;
}
.fish-bar-label { font-size: 10px; color: rgba(255,255,255,.4); white-space: nowrap; }
#fishBar {
  flex: 1; height: 8px;
  background: rgba(255,255,255,.07); border-radius: 4px; overflow: hidden;
  min-width: 70px;
}
#fishFill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #ffd700, #ff9800);
  transition: width .35s ease;
  box-shadow: 0 0 8px rgba(255,183,0,.5);
}

/* ---- GAME + SIDE ---- */
#gameRow {
  position: relative; z-index: 10;
  display: flex; gap: 10px; align-items: flex-start;
  flex: 1; width: 100%; max-width: 900px;
  min-height: 0;
}

/* CANVAS WRAP */
#canvasWrap {
  position: relative; flex-shrink: 0;
}
#mazeCanvas {
  display: block;
  border: 3px solid var(--gold); border-radius: 10px;
  box-shadow: 0 0 28px rgba(245,200,66,.3), inset 0 0 20px rgba(0,0,0,.5);
  image-rendering: pixelated;
}

/* floating fish ambient on canvas bg */
.fish-ambient {
  position: absolute; pointer-events: none; z-index: 0;
  animation: fa var(--dur,20s) linear infinite;
  opacity: .15; font-size: var(--sz,22px);
  bottom: var(--bot,40%);
}
@keyframes fa {
  0%   { transform: translateX(-60px); }
  100% { transform: translateX(110vw); }
}

/* SIDE PANEL */
#side {
  display: flex; flex-direction: column; gap: 8px;
  width: 130px; flex-shrink: 0;
  overflow-y: auto; max-height: 100%;
}
#side::-webkit-scrollbar { width: 0; }

.card {
  background: rgba(5,12,24,.9);
  border: 1.5px solid rgba(91,200,240,.2);
  border-radius: 10px; padding: 9px 10px;
  backdrop-filter: blur(4px);
}
.card h3 {
  font-family: 'Cabin Sketch', cursive; font-size: 12px;
  color: var(--splash); margin-bottom: 7px; text-align: center;
}
.leg { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 11px; color: rgba(240,230,200,.75); }
.leg-ico { font-size: 14px; flex-shrink: 0; }
.ctrl-key { font-size: 10px; color: rgba(240,230,200,.6); line-height: 1.9; }

/* D-PAD */
#dpad {
  display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 36px);
  gap: 3px; justify-content: center; margin-top: 8px;
}
.dbtn {
  background: rgba(245,200,66,.1); border: 1.5px solid rgba(245,200,66,.4);
  border-radius: 7px; color: var(--gold); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .1s; user-select: none; touch-action: manipulation;
}
.dbtn:active, .dbtn.pressed {
  background: rgba(245,200,66,.35); transform: scale(.9);
  box-shadow: 0 0 10px rgba(245,200,66,.5);
}
.dbtn.empty { background: transparent; border-color: transparent; pointer-events: none; }

/* ---- OVERLAYS ---- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,6,18,.9); backdrop-filter: blur(10px);
}
.overlay-box {
  background: linear-gradient(160deg, #081428, #0a1e38);
  border: 2.5px solid var(--gold); border-radius: 20px;
  padding: 28px 34px; text-align: center;
  max-width: 400px; width: 94%;
  box-shadow: 0 0 60px rgba(245,200,66,.25);
  animation: popIn .35s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes popIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ov-title {
  font-family: 'Cabin Sketch', cursive; font-size: 30px; color: var(--gold);
  text-shadow: 0 0 20px rgba(245,200,66,.7); margin-bottom: 4px;
}
.ov-title span { color: var(--splash); }
.ov-sub { font-size: 13px; color: rgba(240,230,200,.55); margin-bottom: 16px; font-style: italic; }

.welcome-box {
  background: rgba(245,200,66,.07); border: 1px solid rgba(245,200,66,.25);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; text-align: left;
}
.welcome-box h4 {
  font-family: 'Cabin Sketch', cursive; color: var(--gold); font-size: 13px;
  margin-bottom: 8px; text-align: center;
}
.wb { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.wb-ico { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.wb-text strong { color: #ffe082; display: block; font-size: 12px; }
.wb-text span { font-size: 11px; color: rgba(240,230,200,.55); }

.big-btn {
  background: linear-gradient(135deg, #e85d00, #f5c842);
  border: none; border-radius: 12px;
  color: #1a0800; font-family: 'Cabin Sketch', cursive; font-size: 20px;
  padding: 12px 0; cursor: pointer; width: 100%;
  box-shadow: 0 4px 20px rgba(232,90,0,.5); transition: all .2s;
  animation: ctaPulse 2.5s ease-in-out infinite;
}
@keyframes ctaPulse { 0%,100%{box-shadow:0 4px 20px rgba(232,90,0,.5)} 50%{box-shadow:0 6px 30px rgba(232,90,0,.8),0 0 0 5px rgba(245,200,66,.12)} }
.big-btn:hover { transform: translateY(-2px); }

.ov-note { font-size: 10px; color: rgba(240,230,200,.28); font-style: italic; margin-top: 10px; }

/* LEVEL COMPLETE */
#levelMsg {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(5,14,32,.97); border: 2px solid var(--gold);
  border-radius: 16px; padding: 22px 42px; z-index: 80;
  text-align: center; display: none;
  box-shadow: 0 0 50px rgba(245,200,66,.35);
  animation: popIn .3s both;
}
#levelMsg h2 { font-family:'Cabin Sketch',cursive; font-size:26px; color:var(--gold); margin-bottom:5px; }
#levelMsg p { color:rgba(240,230,200,.6); font-size:13px; }

/* CONFETTI particles */
.conf {
  position: fixed; z-index: 79; pointer-events: none;
  width: 8px; height: 8px; border-radius: 2px;
  animation: confFall var(--d,1.5s) ease-in forwards;
}
@keyframes confFall {
  0%   { transform: translateY(var(--sy)) rotate(0deg) translateX(var(--sx)); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) translateX(var(--ex)); opacity: 0; }
}

/* TOAST */
#toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(4,20,50,.96); border: 1.5px solid var(--gold);
  border-radius: 9px; padding: 7px 18px;
  color: #ffe082; font-size: 13px; font-weight: 700;
  z-index: 200; opacity: 0; transition: opacity .25s;
  pointer-events: none; white-space: nowrap;
}
#toast.show { opacity: 1; }

/* SPEED INDICATOR */
#speedBar {
  position: absolute; bottom: 3px; left: 3px; right: 3px;
  height: 4px; border-radius: 2px; background: rgba(255,255,255,.06);
  display: none;
}
#speedFill {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #ff9800, #ffeb3b);
  box-shadow: 0 0 6px rgba(255,152,0,.8);
  transition: width .1s;
}

/* RESPONSIVE */
@media (max-width: 700px) {
  #side { display: none; }
  .hud-title { font-size: 16px; }
  .stat { min-width: 48px; padding: 2px 6px; }
  .stat-v { font-size: 14px; }
  #bonusBanner { display: none; }
}
@media (max-width: 480px) {
  nav { padding: 0 10px; }
  .nav-links { display: none; }
  .hud-stats { gap: 4px; }
}

/* Extracted inline utilities */
.u-game-001{color:var(--splash)}
.u-game-002{display:flex;align-items:center;gap:6px;}
.u-game-003{width:0%}
.u-game-004{width:100%}

.game-over-sub{margin-bottom:10px}.game-over-stats{font-size:14px;color:rgba(240,230,200,.65);margin:10px 0}.game-over-value{color:var(--gold)}.game-over-icon{font-size:52px;margin:10px 0}.screen-flash{position:fixed;inset:0;background:rgba(192,57,43,.25);z-index:60;pointer-events:none;animation:fadeOut .4s forwards}.score-popup{position:fixed;transform:translateX(-50%);font-family:'Cabin Sketch',cursive;font-size:18px;color:#ffd700;text-shadow:0 0 8px rgba(255,215,0,.8);pointer-events:none;z-index:90;animation:scoreUp .9s ease forwards;font-weight:bold;white-space:nowrap}@keyframes fadeOut{to{opacity:0}}@keyframes scoreUp{0%{transform:translateX(-50%) translateY(0);opacity:1}100%{transform:translateX(-50%) translateY(-50px);opacity:0}}

/* unique-domain-theme: kuzlolesiisga.pro | arabic-lake */
:root{--unique-bg:#061524;--unique-accent:#36c2ff;--unique-warm:#f5b94a;}
body{direction:rtl;}
a,button{letter-spacing:0 !important;}
