/* ============================================================
   Elifoot 98 Web — tema Windows 98, adaptado a tela de celular
   ============================================================ */

:root {
  --face:        #c0c0c0;
  --face-dark:   #a8a8a8;
  --hi:          #ffffff;
  --sh:          #808080;
  --dsh:         #000000;
  --desktop:     #008080;
  --title-a1:    #000080;
  --title-a2:    #1084d0;
  --title-i1:    #808080;
  --title-i2:    #b5b5b5;
  --sel:         #000080;
  --sel-fg:      #ffffff;
  --ink:         #000000;
  --field:       #ffffff;
  --green:       #007800;
  --red:         #a00000;
  --gold:        #806000;

  --fs:          13px;
  --fs-sm:       11px;
  --tap:         38px;

  --ui: Tahoma, "MS Sans Serif", Geneva, Verdana, sans-serif;
  --mono: "Lucida Console", "Courier New", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--desktop);
  font-family: var(--ui);
  font-size: var(--fs);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

body { display: flex; flex-direction: column; }

/* ---------- relevos 3D ------------------------------------ */
.out { border: 2px solid; border-color: var(--hi) var(--dsh) var(--dsh) var(--hi);
       box-shadow: inset 1px 1px 0 var(--face), inset -1px -1px 0 var(--sh); }
.in  { border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
       box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--face); }
.flat { border: 1px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh); }

/* ---------- janela ---------------------------------------- */
#app { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0; }

.window {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  background: var(--face);
  border: 2px solid; border-color: var(--hi) var(--dsh) var(--dsh) var(--hi);
  box-shadow: inset 1px 1px 0 var(--face), inset -1px -1px 0 var(--sh);
}

.titlebar {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 3px 3px 4px; margin: 2px;
  background: linear-gradient(90deg, var(--title-a1), var(--title-a2));
  color: #fff; font-weight: bold; font-size: var(--fs);
  flex: 0 0 auto; user-select: none;
}
.titlebar .t-icon { width: 16px; height: 16px; flex: 0 0 auto; image-rendering: pixelated; }
.titlebar .t-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titlebar .t-btn {
  width: 20px; height: 18px; flex: 0 0 auto;
  background: var(--face); color: #000;
  border: 2px solid; border-color: var(--hi) var(--dsh) var(--dsh) var(--hi);
  font: bold 11px var(--ui); line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.titlebar .t-btn:active { border-color: var(--dsh) var(--hi) var(--hi) var(--dsh); }

/* ---------- barra de menu --------------------------------- */
.menubar {
  display: flex; flex: 0 0 auto; padding: 1px 2px; gap: 0;
  border-bottom: 1px solid var(--sh); overflow-x: auto; scrollbar-width: none;
}
.menubar::-webkit-scrollbar { display: none; }
.menubar button {
  background: none; border: 1px solid transparent; padding: 4px 8px;
  font: var(--fs) var(--ui); color: var(--ink); white-space: nowrap;
  min-height: 26px;
}
.menubar button.on { background: var(--sel); color: var(--sel-fg); }

/* ---------- corpo com scroll ------------------------------ */
.body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px; display: flex; flex-direction: column; gap: 6px;
}

/* ---------- barra de estado ------------------------------- */
.statusbar {
  flex: 0 0 auto; display: flex; gap: 2px; padding: 2px; font-size: var(--fs-sm);
  border-top: 1px solid var(--hi);
}
.statusbar > span {
  padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
}
.statusbar > span:first-child { flex: 1; }

/* ---------- botões ---------------------------------------- */
button, .btn {
  font: var(--fs) var(--ui); color: var(--ink);
  background: var(--face); padding: 6px 10px; min-height: var(--tap);
  border: 2px solid; border-color: var(--hi) var(--dsh) var(--dsh) var(--hi);
  box-shadow: inset 1px 1px 0 var(--face), inset -1px -1px 0 var(--sh);
  cursor: pointer; user-select: none;
}
button:active:not(:disabled), .btn:active {
  border-color: var(--dsh) var(--hi) var(--hi) var(--dsh);
  box-shadow: inset 1px 1px 0 var(--sh), inset -1px -1px 0 var(--face);
  padding: 7px 9px 5px 11px;
}
button:disabled { color: var(--sh); text-shadow: 1px 1px 0 var(--hi); cursor: default; }
button.wide { width: 100%; }
button.primary { font-weight: bold; }

.row { display: flex; gap: 6px; flex-wrap: wrap; }
.row > * { flex: 1; }
.row.tight { gap: 4px; }

/* ---------- grupos / fieldset ----------------------------- */
fieldset {
  border: 1px solid var(--sh); border-right-color: var(--hi); border-bottom-color: var(--hi);
  margin: 0; padding: 8px; position: relative; background: var(--face);
  box-shadow: 1px 1px 0 var(--hi) inset;
}
legend { padding: 0 4px; font-size: var(--fs-sm); font-weight: bold; }

.panel {
  background: var(--face); padding: 8px;
  border: 2px solid; border-color: var(--hi) var(--dsh) var(--dsh) var(--hi);
  box-shadow: inset 1px 1px 0 var(--face), inset -1px -1px 0 var(--sh);
}
.sunken {
  background: var(--field); padding: 6px;
  border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--face);
}

/* ---------- campos ---------------------------------------- */
input, select {
  font: var(--fs) var(--ui); color: var(--ink); background: var(--field);
  padding: 6px; min-height: var(--tap); width: 100%;
  border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--face);
  border-radius: 0;
}
input[type=range] { padding: 0; box-shadow: none; border: none; background: none; }
label.field { display: block; font-size: var(--fs-sm); margin-bottom: 2px; }

/* ---------- listas / tabelas ------------------------------ */
.list {
  background: var(--field);
  border: 2px solid; border-color: var(--sh) var(--hi) var(--hi) var(--sh);
  box-shadow: inset 1px 1px 0 var(--dsh), inset -1px -1px 0 var(--face);
  overflow: auto; -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table th {
  background: var(--face); font-weight: normal; text-align: left;
  padding: 5px 4px; position: sticky; top: 0; z-index: 1;
  border: 1px solid; border-color: var(--hi) var(--sh) var(--sh) var(--hi);
  white-space: nowrap;
}
table td { padding: 5px 4px; border-bottom: 1px solid #e0e0e0; white-space: nowrap; }
table tr.sel td { background: var(--sel); color: var(--sel-fg); }
table tr.me td { font-weight: bold; }
table tr.tap { cursor: pointer; }
.num { text-align: right; font-family: var(--mono); }
.zone-up   { border-left: 4px solid #0060c0; }
.zone-down { border-left: 4px solid #c00000; }
.zone-none { border-left: 4px solid transparent; }

/* ---------- diversos -------------------------------------- */
.flag { width: 20px; height: 15px; image-rendering: pixelated; vertical-align: -2px; border: 1px solid var(--sh); }
.kit { display: inline-block; width: 12px; height: 12px; border: 1px solid #000; vertical-align: -1px; }
.kit i { display: block; width: 100%; height: 50%; }

.hd { font-weight: bold; font-size: var(--fs); margin: 0; }
.dim { color: #505050; }
.sm { font-size: var(--fs-sm); }
.pos { display: inline-block; width: 26px; font-family: var(--mono); font-size: var(--fs-sm); }
.pos-0 { color: #806000; } .pos-1 { color: #004080; }
.pos-2 { color: #006000; } .pos-3 { color: #900000; }
.good { color: var(--green); } .bad { color: var(--red); }
.warn { color: var(--gold); }

.badge { font-family: var(--mono); font-size: var(--fs-sm); padding: 0 3px;
         border: 1px solid var(--sh); background: var(--face); }

.bar { height: 10px; background: var(--field); border: 1px solid var(--sh); position: relative; }
.bar > i { display: block; height: 100%; background: var(--sel); }
.bar.b-ok > i { background: #008000; }
.bar.b-mid > i { background: #b8860b; }
.bar.b-low > i { background: #a00000; }

.scoreline { display: flex; align-items: center; gap: 6px; font-weight: bold; }
.scoreline .s { font-family: var(--mono); font-size: 18px; }

.pitch {
  background: #1a6b1a; border: 2px solid #0d4a0d; position: relative;
  aspect-ratio: 3 / 4; width: 100%; max-width: 340px; margin: 0 auto;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 8%, rgba(255,255,255,.05) 8% 16%);
}
.pitch .mark { position: absolute; border: 2px solid rgba(255,255,255,.55); }
.pitch .slot {
  position: absolute; transform: translate(-50%, -50%);
  width: 46px; text-align: center; font-size: 9px; color: #fff;
  text-shadow: 1px 1px 0 #000; line-height: 1.1;
}
.pitch .slot b { display: block; width: 22px; height: 22px; margin: 0 auto 2px;
  border: 1px solid #000; font-size: 10px; line-height: 20px; color: #000; background: #fff; }

.log { font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.5; }
.log div { padding: 1px 0; }
.log .min { display: inline-block; width: 30px; color: #606060; }
.log .goal { font-weight: bold; background: #ffffc0; }

.news { display: flex; gap: 6px; align-items: flex-start; padding: 4px 0; border-bottom: 1px dotted var(--sh); }
.news:last-child { border-bottom: none; }
.news .ic { flex: 0 0 auto; font-size: 14px; }

.center { text-align: center; }
.mt { margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.kv b { font-family: var(--mono); }

.splash { text-align: center; padding: 18px 10px; }
.splash h1 { font-size: 30px; margin: 0 0 2px; letter-spacing: -1px;
  color: var(--title-a1); text-shadow: 2px 2px 0 var(--hi), 3px 3px 0 var(--sh); }
.splash .sub { font-size: var(--fs-sm); margin-bottom: 14px; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal { width: 100%; max-width: 420px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--face);
  border: 2px solid; border-color: var(--hi) var(--dsh) var(--dsh) var(--hi);
  box-shadow: inset 1px 1px 0 var(--face), inset -1px -1px 0 var(--sh), 3px 3px 8px rgba(0,0,0,.4); }
.modal .body { padding: 8px; }

@media (min-width: 620px) {
  :root { --fs: 14px; --fs-sm: 12px; }
  #app { padding: 8px; max-width: 720px; margin: 0 auto; width: 100%; }
}
