/* styles.css (zelfde stijl, licht TribalWars-achtig) */
:root{
  --bg:#e7dcc6;
  --panel:#f2ead7;
  --panel2:#e9dec7;
  --stroke:#b9ab8c;
  --stroke2:#9f916f;

  --gold:#b48a2b;
  --text:#1c1a16;
  --muted:#3c372f;

  --ok:#0b7a2a;
  --bad:#a41313;

  --radius:14px;
  --shadow: 0 10px 22px rgba(0,0,0,.18);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  line-height:1.35;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(180,138,43,.20), transparent 55%),
    radial-gradient(900px 700px at 110% 20%, rgba(11,122,42,.12), transparent 50%),
    linear-gradient(180deg, #f2ead7, #e7dcc6 45%, #dfd1b6);
}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(242,234,215,.88);
  border-bottom: 1px solid rgba(159,145,111,.55);
}
.topbar-inner{
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  flex-wrap:wrap;
}

.brand{display:flex; align-items:center; gap:10px; min-width:0}
.brandTxt{min-width:0}
.brand h1{margin:0; font-size:16px; line-height:1.1; white-space:nowrap}
.brand .sub{margin:2px 0 0; font-size:12px; color:var(--muted)}
@media (min-width:820px){ .brand h1{font-size:18px;} }

.logo{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(180,138,43,.55);
  box-shadow: 0 8px 18px rgba(0,0,0,.15);
  background: rgba(255,255,255,.35);
}

.wrap{
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 12px 140px;
}

.card{
  background:
    radial-gradient(900px 500px at 20% -40%, rgba(180,138,43,.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(0,0,0,.02)),
    linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid rgba(159,145,111,.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  margin: 10px 0;
}
.compactCard{ padding-bottom: 10px; }

.title-row{
  display:flex; align-items:center; justify-content: space-between;
  gap:10px; flex-wrap:wrap;
}
h2{
  margin:0 0 8px;
  font-size: 12px;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.miniDivider{
  height:1px;
  background: rgba(159,145,111,.45);
  margin: 8px 0;
}

label{
  display:block;
  font-weight: 900;
  font-size: 11px;
  margin: 7px 0 5px;
}
.hint{font-size: 11px; color: var(--muted); margin-top: 5px}
.muted{color: var(--muted); font-size: 11px}

input[type="number"], input[type="text"], select, textarea{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(159,145,111,.75);
  background: rgba(255,255,255,.70);
  color: var(--text);
  outline: none;
  font-size: 16px;
}
textarea{ resize: vertical; min-height: 140px; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(180,138,43,.85);
  box-shadow: 0 0 0 4px rgba(180,138,43,.18);
}

.grid-2{display:grid; grid-template-columns:1fr; gap:10px}
.grid-3{display:grid; grid-template-columns:1fr; gap:10px}
.grid-5{display:grid; grid-template-columns:1fr; gap:10px}
@media (min-width: 900px){
  .grid-2{grid-template-columns: 1fr 1fr}
  .grid-3{grid-template-columns: 1fr 1fr 1fr}
  .grid-5{grid-template-columns: 1fr 1fr 1fr 1fr 1fr}
}
@media (max-width: 520px){
  .grid-5{grid-template-columns:1fr 1fr}
}

.setupActions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  margin-top: 10px;
  flex-wrap:wrap;
}
.pasteActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.chip{
  display:inline-flex; align-items:center; gap:6px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(180,138,43,.35);
  background: rgba(255,255,255,.55);
  color: var(--muted);
  font-size: 12px;
  user-select:none;
}

.btn{
  appearance:none;
  border: 1px solid rgba(180,138,43,.70);
  background: rgba(180,138,43,.18);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor:pointer;
  min-height: 40px;
}
.btn:active{transform: translateY(1px);}
.btnGhost{
  border: 1px solid rgba(159,145,111,.65);
  background: rgba(255,255,255,.45);
}
.smallBtn{min-height: 36px; padding: 8px 10px}

.resIco{
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.out{
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(159,145,111,.55);
  background: rgba(255,255,255,.60);
  font-size: 13px;
  line-height: 1.55;
}
.compactOut{padding: 9px 10px;}
.rowline{display:flex; justify-content: space-between; gap:10px; flex-wrap:wrap;}
.k{color: var(--muted);}
.v{font-weight: 900;}
.ok{color: var(--ok);}

.flagPickBtn{
  display:flex; align-items:center; justify-content: space-between;
  gap:10px;
  width:100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(159,145,111,.65);
  background: rgba(255,255,255,.60);
  cursor:pointer;
  color: var(--text);
  text-align:left;
  min-height: 48px;
}
.flagLeft{display:flex; align-items:center; gap:10px; min-width:0}
.flagImg{
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(180,138,43,.30);
  background: rgba(255,255,255,.55);
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  flex:0 0 auto;
}
.flagImg img{width:100%; height:100%; object-fit: cover; display:block}
.flagMeta{min-width:0}
.flagName{font-weight: 900; white-space: nowrap; overflow:hidden; text-overflow: ellipsis}
.flagPct{font-size: 11px; color: var(--muted)}
.chev{opacity:.8; font-size: 18px}

.boosterLabel{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(159,145,111,.55);
  background:rgba(255,255,255,.55);
  cursor:pointer;
  font-size:14px;
  transition:all .15s ease;
}
.boosterLabel:hover{
  background:rgba(255,255,255,.75);
  transform:translateY(-1px);
}
.boosterIcon{width:22px;height:22px;display:flex;align-items:center;justify-content:center}
.boosterText{font-weight:700;}
.boosterHint{margin-left:auto;font-size:12px;opacity:.75;}

/* Sticky total */
.stickyTotal{
  position: fixed; left:0; right:0; bottom:0;
  z-index: 70;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(242,234,215,.92);
  border-top: 1px solid rgba(159,145,111,.55);
  backdrop-filter: blur(10px);
}
.stickyInner{
  max-width: 1280px;
  margin:0 auto;
  display:flex;
  justify-content:flex-end;
}
.totBox{
  width: min(640px, 100%);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(159,145,111,.55);
  background: rgba(255,255,255,.60);
}
.totResRow{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.totRes{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  min-width: 0;
}
@media (max-width: 520px){
  .totResRow{ grid-template-columns: 1fr; gap: 6px; }
}

/* Modal */
.modalBackdrop{
  position: fixed; inset:0;
  background: rgba(0,0,0,.35);
  z-index: 200;
  display:none;
  align-items:flex-end;
  justify-content:center;
  padding: 10px;
}
.modal{
  width: min(940px, 100%);
  max-height: min(76vh, 560px);
  border-radius: 14px;
  border: 1px solid rgba(159,145,111,.65);
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(0,0,0,.02)),
              linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction: column;
}
.modalTop{
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap:10px;
  border-bottom: 1px solid rgba(159,145,111,.45);
}
.modalBody{
  padding: 10px 12px;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}
.flagGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 680px){ .flagGrid{grid-template-columns: 1fr 1fr;} }
@media (min-width: 980px){ .flagGrid{grid-template-columns: 1fr 1fr 1fr;} }
.flagCard{
  border: 1px solid rgba(159,145,111,.55);
  background: rgba(255,255,255,.55);
  border-radius: 12px;
  padding: 8px;
  display:flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  min-height: 58px;
}
.flagCard:hover{border-color: rgba(180,138,43,.70)}
.flagCard .img{
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(180,138,43,.30);
  overflow:hidden;
  background: rgba(255,255,255,.60);
  flex: 0 0 auto;
}
.flagCard img{width:100%; height:100%; object-fit: cover; display:block}
.flagCard .txt{min-width:0}
.flagCard .txt b{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.flagCard .txt span{color: var(--muted); font-size: 11px}
