:root{
  --bg:#0b1220;
  --panel:#121d30;
  --panel2:#18263d;
  --text:#f2f6ff;
  --muted:#9eafc8;
  --green:#48e09a;
  --line:#293a54;
  --orange:#ffbd59;
}
*{box-sizing:border-box}
body{
  margin:0;
  background:linear-gradient(160deg,#0b1220,#101b2d 65%,#0b1220);
  font-family:system-ui,-apple-system,Segoe UI,sans-serif;
  color:var(--text);
}
.wrap{max-width:1180px;margin:auto;padding:20px}
header{display:flex;align-items:center;gap:14px;margin-bottom:22px}
.logo{width:54px;height:54px;border-radius:17px;background:var(--green);color:#062117;display:grid;place-items:center;font-size:28px;font-weight:900}
h1{font-size:27px;margin:0}
.sub{color:var(--muted);font-size:13px;margin-top:3px}
.tag{margin-left:auto;border:1px solid #315444;color:var(--green);padding:7px 10px;border-radius:999px;font-size:12px}

.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}
.card,.panel{background:rgba(18,29,48,.96);border:1px solid var(--line);border-radius:18px;padding:17px}
.label{color:var(--muted);font-size:12px}
.num{font-size:30px;font-weight:800;margin-top:7px}
.accent{color:var(--green)}
.tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
button,.filebtn{border:0;border-radius:11px;padding:11px 14px;background:var(--panel2);color:var(--text);font-weight:700;cursor:pointer}
button.active,button.primary{background:var(--green);color:#062117}
button:hover,.filebtn:hover{filter:brightness(1.12)}
.layout{display:grid;grid-template-columns:1fr 1.15fr;gap:14px}
h2{font-size:17px;margin:0 0 14px}
.section-gap{margin-top:20px}
label{display:block;color:var(--muted);font-size:12px;margin:11px 0 5px}
input,select,textarea{width:100%;background:#0b1423;border:1px solid var(--line);border-radius:10px;padding:11px;color:var(--text);font:inherit}
.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.form-actions{display:flex;gap:8px;margin-top:15px;flex-wrap:wrap}
.no-margin{margin:0}
.history-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.tablewrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;font-size:13px}
th,td{padding:11px 9px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
th{color:var(--muted);font-weight:600}
.pill{padding:4px 8px;border-radius:999px;background:#213c35;color:var(--green);font-size:11px}
.pill.train{background:#332d4d;color:#c9b8ff}
.empty{color:var(--muted);text-align:center;padding:25px}
.barrow{margin:13px 0}
.barlabel{display:flex;justify-content:space-between;font-size:13px;margin-bottom:6px}
.bar{height:8px;background:#24334a;border-radius:99px;overflow:hidden}
.fill{height:100%;background:var(--green);border-radius:99px}
.footer{color:var(--muted);font-size:12px;margin:18px 0 6px;text-align:center}
.hidden{display:none!important}
.danger{color:#ff9b9b}

/* MAX GOL ARENA */
.game-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.game-stats{display:flex;gap:9px;flex-wrap:wrap}
.stat-chip{padding:7px 10px;background:#23334a;border-radius:9px;font-size:12px;color:#e4efff}
.stat-chip b{color:#48e09a}
.arena-shell{display:flex;justify-content:center}
.arena{
  background:linear-gradient(180deg,#0f6844,#0d5739);
  border:2px solid #386752;
  border-radius:16px;
  overflow:hidden;
  position:relative;
  touch-action:none;
  width:min(100%,960px);
  height:clamp(360px,calc(100vh - 300px),680px);
  max-height:min(72vh,680px);
  margin:auto;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05),0 10px 30px rgba(0,0,0,.28);
}
.arena canvas{width:100%;height:100%;display:block;touch-action:none;user-select:none}
.arena-cover{position:absolute;inset:0;background:rgba(5,18,25,.84);display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:18px;gap:12px}
.arena-cover h2{font-size:26px;margin:0}
.arena-cover p{max-width:450px;line-height:1.55;margin:0;color:#d5e7e5}
.arena-cover button{font-size:17px;background:#48e09a;color:#052418}
.controlbar{display:flex;justify-content:space-between;gap:12px;align-items:center;max-width:960px;margin:12px auto}
.dpad{display:grid;grid-template-columns:repeat(3,54px);grid-template-rows:repeat(3,46px);gap:3px}
.dpad button{padding:0;background:#243e51;border:1px solid #426273;font-size:21px;touch-action:none;user-select:none}
.dpad .up{grid-column:2;grid-row:1}
.dpad .left{grid-column:1;grid-row:2}
.dpad .down{grid-column:2;grid-row:3}
.dpad .right{grid-column:3;grid-row:2}
.shoot{width:118px;height:96px;border-radius:50%;background:linear-gradient(145deg,#f7bf4b,#ef6d34);color:#242017;box-shadow:0 5px 0 #9c431e;font-size:18px;touch-action:none;user-select:none}
.game-help{text-align:center;font-size:12px;color:#a3b7c8}
.reward-line{display:flex;gap:8px;flex-wrap:wrap}
.reward{padding:10px 12px;background:#1b3043;border:1px solid #294a59;border-radius:12px;font-size:13px}
.mission-row{padding:10px 0;border-bottom:1px solid #293a54;display:flex;justify-content:space-between;gap:12px;align-items:center}
.mission-row:last-child{border:0}
.mission-row small{display:block;color:#9eafc8;margin-top:4px}
.mission-row button:disabled{opacity:.6;cursor:default}
.shop-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:10px}
.shop-item{background:#1b2a3e;border:1px solid #2c405b;border-radius:12px;padding:14px}
.shop-item strong{display:block;margin-bottom:7px}
.shop-item button{margin-top:9px;width:100%}
.profile-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.level-track{background:#293c53;height:11px;border-radius:99px;overflow:hidden;margin:12px 0}
.level-fill{height:100%;background:linear-gradient(90deg,#48e09a,#c1f665)}
.toast-game{position:absolute;top:20px;left:50%;transform:translateX(-50%);font-size:28px;font-weight:900;color:#fff;text-shadow:0 3px 10px rgba(0,60,35,.95);pointer-events:none;white-space:nowrap;opacity:0;transition:opacity .2s;background:rgba(8,35,29,.46);padding:10px 14px;border-radius:999px}
.toast-game.show{opacity:1}

@media(max-width:920px){
  .cards{grid-template-columns:repeat(2,1fr)}
  .layout{grid-template-columns:1fr}
  .wrap{padding:14px}
  .tag{display:none}
  .arena{height:min(65vh,560px)}
}
@media(max-width:640px){
  .controlbar{max-width:100%;gap:10px}
  .shoot{width:100px;height:86px;font-size:16px}
}
@media(max-width:520px){
  header{align-items:flex-start}
  .cards{grid-template-columns:1fr 1fr}
  .row,.profile-grid{grid-template-columns:1fr}
  .dpad{grid-template-columns:repeat(3,47px);grid-template-rows:repeat(3,42px)}
  .shoot{width:92px;height:82px}
  .arena{height:min(58vh,460px);min-height:320px}
  .toast-game{font-size:22px}
}

/* Arena responsive: preserves the full field without cropping or stretching. */
#game .panel{padding:clamp(8px,1.3vw,17px)}
#game .arena-shell{width:100%;min-width:0;justify-content:center}
#game .arena{
  box-sizing:border-box;
  width:min(100%, calc((100dvh - 240px) * 600 / 780), 600px);
  height:auto;
  aspect-ratio:600 / 780;
  min-height:0;
  max-height:none;
  margin:0 auto;
  flex:0 1 auto;
}
#game .arena canvas{width:100%;height:100%}
#game .controlbar{max-width:600px;margin:8px auto}
#game .dpad{grid-template-columns:repeat(3,42px);grid-template-rows:repeat(3,36px)}
#game .shoot{width:92px;height:78px;font-size:14px}
#game .game-help{font-size:11px}
@media(max-width:640px){
 #game .arena{width:min(100%,calc((100dvh - 275px) * 600 / 780),600px);min-height:0;height:auto}
 #game .dpad{grid-template-columns:repeat(3,38px);grid-template-rows:repeat(3,34px)}
 #game .shoot{width:82px;height:70px}
}
@media(max-height:650px) and (min-width:700px){
 #game .arena{width:min(100%,calc((100dvh - 195px) * 600 / 780),600px)}
 #game .game-help{display:none}
 #game .dpad{grid-template-columns:repeat(3,32px);grid-template-rows:repeat(3,27px)}
 #game .shoot{height:60px;width:70px}
}
