* {
  box-sizing: border-box;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111; color: white;
  min-height: 100vh; min-height: 100dvh;
}
/* En PC, centrar todo en columna estrecha tipo móvil */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#login-screen, #main-screen {
  width: 100%;
  max-width: 480px;
}

#login-screen {
  display: flex; flex-direction: column; gap: 12px;
  padding: 24px; margin: 40px auto;
}
#login-screen h2 { margin: 0 0 8px; font-size: 24px; }
#login-screen input, #login-screen button {
  font-size: 18px; padding: 14px;
  border-radius: 8px; border: 1px solid #333;
  background: #222; color: white;
  width: 100%;
}
#login-screen button { background: #0070f3; font-weight: bold; cursor: pointer; border: none; }
#login-status { color: #f55; min-height: 20px; font-size: 14px; }

#main-screen {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  padding: 8px; gap: 8px;
}
header { padding: 8px 4px; font-size: 13px; }
.stakes-row { font-size: 11px; color: #888; margin-top: 4px; }
.status-row {
  display: flex; justify-content: space-between;
  align-items: center; gap: 8px; flex-wrap: wrap;
}
.status-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 4px; background: gray;
}
.status-dot.ok { background: #00b894; }
.status-dot.warn { background: #fdcb6e; }
.status-dot.err { background: #d63031; }
.badge-off { background: #d63031; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 11px; }
.badge-on  { background: #00b894; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 11px; }

#scoreboard {
  text-align: center; padding: 16px;
  background: #1a1a1a; border-radius: 12px;
}
.score { font-size: 56px; font-weight: 900; letter-spacing: 4px; }
.edit-score-btn {
  margin-top: 4px; padding: 4px 12px; font-size: 12px;
  background: #333; color: #aaa; border: none; border-radius: 4px;
  cursor: pointer;
}
.edit-score-btn:hover { background: #444; color: white; }
#score-editor {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 10px;
}
#score-editor input[type=number] {
  width: 60px; font-size: 28px; font-weight: bold; text-align: center;
  background: #222; color: white; border: 2px solid #555; border-radius: 8px;
  padding: 6px 0;
}
#score-editor button {
  padding: 8px 14px; font-size: 14px; font-weight: bold;
  border: none; border-radius: 6px; cursor: pointer;
}
#btn-score-ok     { background: #00b894; color: white; }
#btn-score-cancel { background: #555;    color: white; }

.goal-btn {
  flex: 1;
  font-size: 36px; font-weight: 900;
  border: none; border-radius: 16px;
  color: white; cursor: pointer;
  transition: transform 0.05s, background 0.1s;
  min-height: 120px;
  max-height: 200px;
}
.goal-btn:disabled { opacity: 0.4; }
.goal-local { background: #0070f3; }
.goal-away  { background: #d63031; }
.goal-btn:active:not(:disabled) { transform: scale(0.97); }
.goal-btn.feedback-ok  { background: #00b894 !important; }
.goal-btn.feedback-err { background: #6c5ce7 !important; animation: shake 0.4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-10px); }
  40%, 80%  { transform: translateX(10px); }
}

footer { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px; }
footer button {
  flex: 1; padding: 12px; font-size: 14px; font-weight: bold;
  border: none; border-radius: 8px; background: #333; color: white; cursor: pointer;
}
.kill-btn { background: #d63031 !important; }

#feedback-overlay {
  position: fixed; inset: 0; pointer-events: none;
  transition: background 0.1s;
}
#feedback-overlay.flash-ok  { background: rgba(0, 184, 148, 0.4); }
#feedback-overlay.flash-err { background: rgba(214, 48, 49, 0.6); }

#toast-area {
  position: fixed; top: 60px; left: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none; z-index: 100;
}
.toast {
  padding: 10px; border-radius: 6px; font-size: 13px;
  background: rgba(0, 0, 0, 0.85); border-left: 4px solid;
}
.toast.info { border-color: #0070f3; }
.toast.warn { border-color: #fdcb6e; }
.toast.err  { border-color: #d63031; }
