/* =====================================================================
   KENNEL CLASH — STYLESHEET
   Tactical / dog-tag aesthetic. Dark + orange + bone.
===================================================================== */
:root{
  --bg-0:#0a0a0a;
  --bg-1:#141312;
  --bg-2:#1c1a18;
  --bone:#e9dcc1;
  --bone-dim:#a89c83;
  --steel:#3a3733;
  --steel-light:#605b54;
  --orange:#ff6a1f;
  --orange-soft:#ffb38a;
  --red:#d6321a;
  --green:#7bc94a;
  --gold:#e0a830;
  --shadow: 0 12px 32px rgba(0,0,0,.6);
}

*{ box-sizing:border-box; margin:0; padding:0; }
html, body{
  width:100%; height:100%;
  background:
    radial-gradient(1200px 800px at 20% 10%, #1d1814 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 90%, #1a1716 0%, transparent 50%),
    var(--bg-0);
  color: var(--bone);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
body::before{
  /* Subtle film grain */
  content:''; position:fixed; inset:0; pointer-events:none; z-index:1000;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity:.5; mix-blend-mode:overlay;
}
.hidden{ display:none !important; }

/* ----------------- HOME ----------------- */
#homeScreen{
  position:fixed; inset:0;
  display:grid;
  grid-template-rows: auto 1fr auto;
  padding: 24px;
}
.title-block{ text-align:center; margin-top: 28px; }
.title{
  font-family:'Black Ops One', cursive;
  font-size: clamp(48px, 9vw, 132px);
  letter-spacing: 6px;
  color: var(--bone);
  text-shadow: 0 0 1px var(--orange), 0 6px 0 #000, 0 8px 30px rgba(255,106,31,.25);
  line-height:.9;
}
.title span{ color: var(--orange); }
.subtitle{
  font-family:'Bebas Neue', sans-serif;
  letter-spacing: 14px;
  font-size: 14px;
  color: var(--bone-dim);
  margin-top: 14px;
}
.cta-stack{
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:16px;
}
.primary-btn{
  font-family:'Black Ops One', cursive;
  background: linear-gradient(180deg, var(--orange) 0%, #c8501a 100%);
  color:#0b0908; border:0;
  padding: 16px 38px;
  letter-spacing:4px;
  font-size: 22px;
  cursor:pointer;
  border-radius:2px;
  box-shadow: 0 4px 0 #6a2a0d, 0 12px 20px rgba(255,106,31,.35);
  transition: transform .08s, box-shadow .08s;
}
.primary-btn:hover{ transform: translateY(-2px); box-shadow: 0 6px 0 #6a2a0d, 0 16px 26px rgba(255,106,31,.5); }
.primary-btn:active{ transform: translateY(2px); box-shadow: 0 2px 0 #6a2a0d; }
.big-btn{ padding: 22px 64px; font-size: 28px; }
.secondary-btn{
  font-family:'Bebas Neue'; letter-spacing:5px;
  background: transparent; color: var(--bone);
  border: 2px solid var(--steel-light);
  padding: 12px 28px; cursor:pointer;
  border-radius: 2px;
  font-size: 18px;
}
.secondary-btn:hover{ border-color: var(--orange); color: var(--orange); }
.side-buttons{ display:flex; gap:14px; margin-top: 6px; }
.tag-btn{
  font-family:'Black Ops One', cursive;
  background: var(--bg-2);
  border: 1px solid var(--steel);
  color: var(--bone);
  padding: 8px 18px;
  letter-spacing: 3px;
  cursor:pointer;
  font-size: 13px;
}
.tag-btn:hover{ border-color: var(--orange); color: var(--orange); }
.ghost-btn{
  background: transparent; border:1px solid var(--steel-light);
  color: var(--bone); font-family:'JetBrains Mono'; font-size:12px;
  letter-spacing:2px; padding:6px 12px; cursor:pointer; border-radius:2px;
}
.ghost-btn:hover{ border-color: var(--orange); color: var(--orange); }
.ghost-btn.small{ font-size:10px; padding:4px 10px; }
.home-foot{
  text-align:center; font-size: 11px; color: var(--bone-dim); letter-spacing:3px; padding-bottom: 6px;
}

/* Discreet promo box */
.discreet-promo{
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display:flex; align-items:center; gap:6px; opacity:.55;
}
.discreet-promo:hover{ opacity:1; }
.discreet-promo input{
  background: rgba(0,0,0,.5);
  color: var(--bone-dim);
  border: 1px solid var(--steel);
  padding: 4px 10px; width: 180px; font-size:11px;
  font-family:'JetBrains Mono'; letter-spacing:1px;
}
.discreet-promo input:focus{ outline:none; border-color: var(--bone-dim); color:var(--bone); }
.discreet-promo button{
  background: var(--steel); color: var(--bone);
  border:1px solid var(--steel-light);
  padding: 4px 10px; cursor:pointer; font-size: 11px;
}
#promoMsg{ font-size: 10px; color: var(--green); margin-left: 8px; }

/* Account pill */
.account-pill{
  position:absolute; top: 18px; right: 18px;
  display:flex; align-items:center; gap:10px;
  background: rgba(0,0,0,.55); border: 1px solid var(--steel);
  padding: 6px 10px;
}
#accountStatus{ font-size: 11px; letter-spacing:2px; color: var(--bone-dim); }

/* Server status */
.server-status{
  position:absolute; bottom: 22px; left: 22px;
  display:flex; align-items:center; gap:8px;
  font-size: 11px; letter-spacing: 2px; color: var(--bone-dim);
}
.dot{ width:8px; height:8px; border-radius:50%; background: var(--bone-dim); }
.dot.online{ background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.offline{ background: var(--red); }

/* Ad rails */
.ad-rail{
  position:absolute; top: 50%; transform: translateY(-50%);
  width: 160px; height: 600px;
  border:1px dashed var(--steel);
  display:flex; align-items:center; justify-content:center;
}
.ad-left{ left: 18px; }
.ad-right{ right: 18px; }
@media (max-width: 1100px){ .ad-rail{ display:none; } }

/* ------------- OFFLINE OVERLAY ------------- */
#serverOffline{
  position:fixed; inset:0; background: rgba(0,0,0,.85); z-index: 9999;
  display:flex; align-items:center; justify-content:center; backdrop-filter: blur(4px);
}
.offline-card{
  background: var(--bg-1); border: 1px solid var(--red);
  padding: 32px 48px; text-align:center; max-width: 480px;
}
.offline-title{ font-family:'Black Ops One'; font-size: 36px; color: var(--red); letter-spacing: 6px; }
.offline-sub{ margin-top: 16px; color: var(--bone-dim); line-height:1.5; }

/* ------------- MODALS ------------- */
.modal{
  position:fixed; inset:0; z-index: 500;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.78); backdrop-filter: blur(6px);
}
.modal-card{
  background: var(--bg-1);
  border: 1px solid var(--steel);
  padding: 32px;
  width: min(420px, 92vw);
  max-height: 92vh; overflow:auto;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-card.big{ width: min(960px, 96vw); }
.modal-card h2{
  font-family:'Black Ops One'; letter-spacing:5px; color: var(--orange);
  font-size: 22px; margin-bottom: 18px;
}
.close-x{
  position:absolute; top: 8px; right: 12px;
  background: transparent; border:0; color: var(--bone-dim);
  font-size: 24px; cursor:pointer;
}
.close-x:hover{ color: var(--orange); }
.modal input{
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: var(--bg-2); border:1px solid var(--steel);
  color: var(--bone); font-family:'JetBrains Mono';
  letter-spacing: 2px;
}
.modal input:focus{ outline:none; border-color: var(--orange); }
.tabs{ display:flex; gap: 6px; margin-bottom: 16px; }
.tab{
  flex:1; padding: 10px; background: transparent;
  color: var(--bone-dim); border:1px solid var(--steel);
  font-family:'Black Ops One'; letter-spacing: 3px; cursor:pointer; font-size:12px;
}
.tab.active{ color: var(--orange); border-color: var(--orange); }
.tab-pane{ display:flex; flex-direction:column; }
.auth-msg{ margin-top: 8px; font-size:12px; min-height: 16px; color: var(--orange-soft); }

/* ------------- DOGS LAYOUT ------------- */
.dogs-layout{
  display:grid; grid-template-columns: 1fr 1.3fr; gap: 24px;
  min-height: 480px;
}
.dog-list{
  display:flex; flex-direction:column; gap:6px; overflow:auto; max-height: 60vh;
  padding-right: 6px;
}
.dog-row{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--steel);
  cursor:pointer; transition: border-color .15s, transform .1s;
}
.dog-row:hover{ border-color: var(--orange-soft); }
.dog-row.active{ border-color: var(--orange); background: rgba(255,106,31,.08); }
.dog-row .name{ font-family:'Bebas Neue'; letter-spacing: 3px; font-size: 16px; }
.dog-row .price{ font-size: 12px; color: var(--gold); }
.dog-row .owned{ color: var(--green); font-size: 11px; }
.dog-row .selected-tag{ color: var(--orange); font-size: 10px; letter-spacing:2px; }

.dog-detail{ display:flex; flex-direction:column; }
.dog-preview{
  width: 100%; height: 280px;
  background: radial-gradient(circle at 50% 60%, #1f1d1a 0%, #0a0908 80%);
  border: 1px solid var(--steel);
  position: relative;
}
.dog-preview canvas{ width: 100%; height: 100%; display:block; }
.dog-detail h3{
  font-family:'Black Ops One'; letter-spacing:4px;
  margin: 14px 0 8px; color: var(--bone); font-size: 24px;
}
.stats-row{ display:flex; gap: 16px; margin-bottom: 12px; }
.stat-item{
  display:flex; flex-direction:column; align-items:flex-start; flex:1;
}
.stat-label{ font-size: 10px; letter-spacing: 2px; color: var(--bone-dim); margin-bottom: 4px; }
.stat-bar{
  width: 100%; height: 8px; background: var(--bg-2);
  border:1px solid var(--steel); position:relative;
}
.stat-fill{ height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); }
.info-block{ font-size: 12px; color: var(--bone-dim); line-height: 1.7; }
.info-block b{ color: var(--bone); letter-spacing: 1px; }
.action-row{
  margin-top: auto; padding-top: 16px;
  display:flex; justify-content:space-between; align-items:center; gap: 12px;
}
.action-row .price{ font-size: 16px; color: var(--gold); font-family:'Bebas Neue'; letter-spacing:2px; }

/* Accessories */
.acc-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.acc-card{
  background: var(--bg-2); border:1px solid var(--steel); padding: 14px;
  text-align:center; cursor:pointer; transition: border-color .15s;
}
.acc-card:hover{ border-color: var(--orange-soft); }
.acc-card.equipped{ border-color: var(--green); }
.acc-card .acc-name{ font-family:'Bebas Neue'; letter-spacing: 2px; font-size: 14px; }
.acc-card .acc-price{ color: var(--gold); font-size: 11px; margin-top: 6px; }
.acc-card .acc-status{ font-size: 10px; color: var(--bone-dim); margin-top: 4px; letter-spacing:2px; }
.acc-thumb{
  width: 60px; height: 60px; margin: 0 auto 8px;
  border:1px solid var(--steel);
  background: var(--bg-1);
}

/* ------------- GAME / HUD ------------- */
#game{ position:fixed; inset:0; }
#gameCanvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.hud{ position:absolute; inset:0; pointer-events:none; }
.hud > *{ pointer-events: none; }
.hud .ghost-btn{ pointer-events:auto; }
.hud-top{
  position:absolute; top: 18px; left:0; right:0;
  display:flex; justify-content:space-between; align-items:center;
  padding: 0 24px;
}
.hp-bar{
  width: 280px; height: 22px; border:1px solid var(--steel);
  background: rgba(0,0,0,.55); position:relative;
}
#hpFill{ height: 100%; background: linear-gradient(90deg, var(--red), var(--orange)); width: 100%; transition: width .15s; }
.hp-bar span{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size: 12px; letter-spacing: 2px; color: var(--bone);
  text-shadow: 0 1px 2px #000;
}
.kd{ font-family:'Bebas Neue'; letter-spacing:3px; font-size: 18px; color: var(--bone); text-shadow: 0 0 6px #000; }
.hud-top button{ pointer-events: auto; }

.hud-bottom{
  position: absolute; bottom: 24px; left:50%; transform:translateX(-50%);
  display:flex; flex-direction:column; align-items:center; gap: 10px;
}
.mode-bar{ display:flex; gap: 6px; }
.mode-slot{
  font-family:'Black Ops One'; letter-spacing:2px;
  padding: 8px 14px; background: rgba(0,0,0,.55);
  border: 1px solid var(--steel); color: var(--bone-dim);
  font-size: 12px; position:relative;
}
.mode-slot.active{ color: var(--orange); border-color: var(--orange); background: rgba(255,106,31,.15); }
.mode-slot .key{
  position:absolute; top:-6px; right:-6px;
  background: var(--orange); color:#000;
  font-size: 9px; padding: 1px 4px; border-radius: 1px;
}
.cooldown-pip{
  width: 200px; height: 6px; background: var(--bg-2); border:1px solid var(--steel); position:relative;
}
#cdFill{ height: 100%; background: var(--orange); width:0%; transition: width .1s; }
.cooldown-pip span{
  position:absolute; left:50%; top:-18px; transform:translateX(-50%);
  font-size: 10px; letter-spacing: 2px; color: var(--bone-dim);
}

/* Reticle + projectile target circle */
#reticle{
  position:absolute; left:50%; top:50%; width: 8px; height: 8px;
  border:1px solid var(--bone); border-radius:50%;
  transform: translate(-50%, -50%);
}
#targetCircle{
  position:absolute; left:50%; top:50%;
  width: 36px; height: 36px;
  border: 2px solid var(--orange);
  border-radius:50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--orange);
}

/* Kill feed */
#killFeed{
  position:absolute; top: 80px; right: 24px;
  display:flex; flex-direction:column; gap: 4px;
}
.kf-item{
  background: rgba(0,0,0,.7); border-left: 3px solid var(--orange);
  padding: 4px 10px; font-size: 11px; letter-spacing: 1px;
  color: var(--bone); animation: fadeOut 5s forwards;
}
@keyframes fadeOut{ 0%{opacity:1;} 80%{opacity:1;} 100%{opacity:0;} }
#centerMsg{
  position:absolute; left:50%; top: 35%; transform:translateX(-50%);
  font-family:'Black Ops One'; font-size: 36px; letter-spacing: 6px;
  color: var(--orange); text-shadow: 0 0 10px #000;
  opacity:0; transition: opacity .3s;
}
#centerMsg.show{ opacity:1; }

/* ------------- MOBILE CONTROLS ------------- */
#mobileControls{
  position:absolute; inset:0; pointer-events:none;
}
#mobileControls *{ pointer-events: auto; }
#leftStick, #rightStick{
  position:absolute; bottom: 30px; width: 130px; height: 130px;
  border:2px solid rgba(255,255,255,.3); border-radius:50%;
  background: rgba(0,0,0,.3);
}
#leftStick{ left: 20px; }
#rightStick{ right: 20px; }
#leftStickKnob, #rightStickKnob{
  position:absolute; left: 50%; top:50%;
  width: 50px; height: 50px;
  background: rgba(255,106,31,.6); border-radius:50%;
  transform: translate(-50%,-50%);
}
.m-btn{
  position:absolute; background: rgba(0,0,0,.55);
  border:1px solid var(--steel-light); color: var(--bone);
  font-family:'Black Ops One'; letter-spacing:2px;
  padding: 10px 14px; font-size: 12px;
}
.m-attack{ bottom: 170px; right: 24px; width:64px;height:64px;border-radius:50%; border-color: var(--orange); color: var(--orange); }
.m-jump{   bottom: 170px; right: 100px; width:54px;height:54px;border-radius:50%; }
.m-mode{ width: 40px; height: 40px; padding: 0; }
#mBite{ bottom: 240px; right: 14px; }
#mClaw{ bottom: 240px; right: 60px; }
#mWeapon{ bottom: 240px; right: 106px; }
#mAbility{ bottom: 240px; right: 152px; border-color: var(--gold); color: var(--gold); }
@media (pointer: coarse){
  #mobileControls{ display:block; }
}
