/* ==========================================================================
   Napoleon's Last Battles — interface styling (game.css)
   Part of the Tronsoft Games package "napoleons-last-battles" v1.0.0.
   ========================================================================== */
  :root{
    --parch:#efe4c8; --parch2:#f5ecd6; --panel:#f7efd9;
    --ink:#2a2118; --ink2:#5d4e37; --muted:#8a7a5c;
    --rule:#b8a577; --frame:#6b5638;
    --fr:#6fb3d6; --frd:#1c4a63; --al:#d0473a; --ald:#6d1a13; --pr:#49ad5c; --prd:#1c5b28;
    --crt:#f6d873; --crt-hd:#e8922e; --gold:#c9a227;
  }
  *{box-sizing:border-box}
  html,body{margin:0}
  body{
    background:#41341f;
    background-image:radial-gradient(circle at 30% 10%, #5a4a2e, #33281700);
    color:var(--ink);
    font-family:"Segoe UI",Helvetica,Arial,sans-serif;
    font-size:14px; line-height:1.4;
  }
  .wrap{max-width:1400px;margin:0 auto;padding:14px}

  /* ---- header ---- */
  header.top{
    background:linear-gradient(#2c2416,#1c1710);
    border:2px solid #0d0a06; border-radius:8px 8px 0 0;
    padding:14px 20px; color:#efe4c8;
    display:flex; flex-wrap:wrap; align-items:center; gap:14px 26px;
    box-shadow:inset 0 0 0 1px #4a3d26;
  }
  .brand h1{
    margin:0; font-family:Georgia,"Times New Roman",serif; font-weight:800;
    font-size:clamp(20px,3.4vw,34px); letter-spacing:.04em; line-height:.98;
    color:#f3ead2; text-shadow:0 2px 0 #000, 0 0 18px rgba(220,180,90,.25);
  }
  .brand .sub{ font-family:Georgia,serif; font-style:italic; color:var(--gold); font-size:13px; letter-spacing:.02em;}
  .brand .spi{font-size:10px;letter-spacing:.25em;color:#9a8a68;text-transform:uppercase;margin-top:2px}
  .controls{margin-left:auto;display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end}
  .field{display:flex;flex-direction:column;gap:3px}
  .field label{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:#c9b489}
  select,button{font-family:inherit;font-size:13px}
  select{
    background:#f7efd9;border:1px solid #0d0a06;border-radius:4px;padding:6px 8px;color:var(--ink);
    min-width:150px;
  }
  button.act{
    background:linear-gradient(#e8922e,#c9761d); color:#221607; border:1px solid #7a4a12;
    border-radius:4px; padding:7px 14px; font-weight:700; cursor:pointer; letter-spacing:.02em;
    box-shadow:0 1px 0 #f6d873 inset;
  }
  button.act:hover{filter:brightness(1.06)}
  button.act:disabled{opacity:.45;cursor:default;filter:none}

  /* ---- layout ---- */
  .stage{
    display:grid; grid-template-columns:1fr 344px; gap:14px;
    background:var(--frame); border:2px solid #0d0a06; border-top:none;
    border-radius:0 0 8px 8px; padding:14px;
  }
  .brief{
    grid-column:1/-1; margin:-2px 0 2px; color:#f0e6cc; font-family:Georgia,serif; font-style:italic;
    font-size:13.5px; padding:2px 2px;
  }
  .mapwrap{display:flex;flex-direction:column;gap:6px;min-width:0}
  .maptools{display:flex;align-items:center;gap:10px}
  .maptools .hint{font-size:11px;color:#c9b489;font-style:italic}
  .zoomer{margin-left:auto;display:flex;gap:4px}
  button.zoom{
    width:30px;height:26px;border:1px solid #0d0a06;border-radius:4px;cursor:pointer;
    background:#e7dcbf;color:#2a2118;font-weight:800;font-size:15px;line-height:1;
  }
  button.zoom:hover{background:#f6efd9}
  .mapcard{
    background:#d9c9a3; border:3px solid #3a2c18; border-radius:4px; padding:8px;
    overflow:auto; box-shadow:inset 0 0 40px rgba(80,60,30,.4); max-height:80vh;
    cursor:grab;
  }
  .mapcard.panning{cursor:grabbing}
  canvas#map{display:block; image-rendering:auto; background:#efe4c8; border-radius:2px}

  .side{display:flex;flex-direction:column;gap:12px;max-height:80vh;overflow:auto;padding-right:2px}
  .card{background:var(--panel); border:1px solid #0d0a06; border-radius:5px; padding:10px 12px;
    box-shadow:0 1px 0 #fff8e6 inset;}
  .card h3{margin:0 0 7px; font-size:10.5px; letter-spacing:.16em; text-transform:uppercase; color:var(--ink2);
    border-bottom:1px solid var(--rule); padding-bottom:4px; font-weight:800;}
  .muted{color:var(--muted)} .fr{color:var(--frd);font-weight:700} .co{color:var(--ald);font-weight:700}
  .nu{color:var(--muted)}

  /* phase strip */
  #phaseInfo{font-weight:700;font-size:15px;display:flex;align-items:center;gap:7px}
  #phaseInfo em{font-style:normal;color:var(--muted);font-weight:600;font-size:12px}
  .dot{width:12px;height:12px;border-radius:50%;border:1px solid #0006;display:inline-block}
  .rowline{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
  #turnInfo{font-family:Georgia,serif;font-size:13px;color:var(--ink2)}
  #scenName{font-family:Georgia,serif;font-weight:700}

  /* unit tags */
  .utag{display:inline-block;border:1px solid;border-radius:3px;padding:1px 5px;margin:2px 3px 0 0;
    font-size:11px;font-weight:600}
  .utag i{font-weight:400;font-style:italic;opacity:.8}

  /* odds */
  .odds .big{font-family:Georgia,serif;font-size:30px;font-weight:800;color:var(--ald);letter-spacing:.02em}
  .odds div{margin:2px 0}
  .btnrow{display:flex;gap:8px;margin-top:8px}
  button.mini{border-radius:4px;border:1px solid #0d0a06;padding:6px 12px;font-weight:700;cursor:pointer}
  button.resolve{background:#c33427;color:#fff;border-color:#6d1a13}
  button.cancel{background:#e7dcbf;color:#2a2118}
  button.mini:disabled{opacity:.4;cursor:default}

  /* CRT widget */
  table.crt{border-collapse:collapse;width:100%;font-size:10px;font-family:ui-monospace,Menlo,Consolas,monospace}
  table.crt th{background:var(--crt-hd);color:#221607;border:1px solid #a86a18;padding:2px 0;font-weight:800}
  table.crt th.on{background:#7a1f12;color:#ffe;}
  table.crt td{border:1px solid #d9b45a;text-align:center;padding:2px 0;background:var(--crt);color:#4a2f08;font-weight:700}
  table.crt td.on{outline:2px solid #7a1f12;outline-offset:-2px}
  table.crt td.r-De,table.crt td.r-Dr{color:#0d5a1e}
  table.crt td.r-Ae,table.crt td.r-Ar{color:#8a1c0c}
  table.crt td.r-Ex{color:#6a3d00;background:#f0c04a}
  .crtnote{font-size:10px;color:var(--muted);margin-top:5px}

  /* objectives */
  table.obj{border-collapse:collapse;width:100%;font-size:12px}
  table.obj th{text-align:left;font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
    border-bottom:1px solid var(--rule);padding:2px 4px}
  table.obj td{padding:3px 4px;border-bottom:1px dotted #d8c9a5}
  .vp{margin-top:7px;font-size:12px;font-weight:600}
  .theatre{
    font-family:Georgia,serif;font-style:italic;font-weight:700;font-size:12.5px;color:#3d5f80;
    margin:8px 0 2px;cursor:pointer;display:flex;align-items:center;gap:6px;
  }
  .theatre:first-child{margin-top:0}
  .theatre::after{content:"→";font-style:normal;color:var(--muted);font-size:11px}
  .theatre:hover{color:#7a1f12}
  .theatre:focus-visible{outline:2px solid #7a1f12;outline-offset:2px;border-radius:3px}

  /* demoralization */
  .mor{margin-bottom:8px}
  .mor label{font-size:11px;font-weight:700;color:var(--ink2)}
  .mor .brk{color:#b3120b;letter-spacing:.05em}
  .mor .bar{height:8px;background:#e2d4b2;border:1px solid #b09b6f;border-radius:5px;overflow:hidden;margin:3px 0}
  .mor .bar i{display:block;height:100%}
  .mor span{font-size:10px;color:var(--muted)}

  /* log */
  #log{max-height:210px;overflow:auto;display:flex;flex-direction:column;gap:6px}
  .logline{font-size:11.5px;border-left:3px solid var(--gold);padding:2px 0 2px 7px;background:#fbf5e4}
  #status{min-height:16px;font-size:12px;color:#7a1f12;font-weight:700;font-style:italic}

  /* legend */
  .legend{display:grid;grid-template-columns:1fr 1fr;gap:3px 10px;font-size:11px}
  .legend span{display:flex;align-items:center;gap:6px}
  .sw{width:16px;height:12px;border:1px solid #0006;border-radius:2px;display:inline-block}

  /* victory banner */
  #banner{display:none;position:fixed;inset:0;background:rgba(20,15,8,.72);z-index:50;
    align-items:center;justify-content:center}
  #banner .box{background:var(--parch2);border:3px solid #0d0a06;border-radius:8px;padding:26px 34px;text-align:center;
    box-shadow:0 20px 60px #000a}
  #bannerText{font-family:Georgia,serif;font-size:26px;font-weight:800;color:var(--ink)}
  #bannerText small{display:block;font-weight:400;font-size:14px;color:var(--ink2);margin-top:6px}
  #againBtn{margin-top:16px}

  @media (max-width:920px){
    .stage{grid-template-columns:1fr}
    .side{max-height:none}
    .mapcard{max-height:62vh}
  }
