* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: #f6f6f8; font-family: var(--font-sans); color: #1a1a1a; }

button {
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

/* ---- Lock screen ---- */
.lock-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px; gap: 16px;
}
.lock-screen[hidden] { display: none; }
.lock-screen h1 { font-family: var(--font-serif); font-style: italic; color: var(--mh-blue); margin: 0; }
.lock-screen input {
  width: 100%; max-width: 320px;
  padding: 16px; font-size: 24px; text-align: center;
  border: 2px solid var(--mh-blue); border-radius: 12px;
  background: white;
}
.lock-screen button {
  width: 100%; max-width: 320px;
  padding: 18px; font-size: 18px;
  background: var(--mh-blue); color: white;
}
.error { color: var(--mh-red); font-weight: 700; }

/* ---- Control view ---- */
.control { padding: 16px; max-width: 480px; margin: 0 auto; }
.control header { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 4px 16px; }
.control header > :first-child { font-family: var(--font-serif); font-style: italic; font-size: 20px; color: var(--mh-blue); }
.control header > :last-child { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }

.team {
  background: white; border-radius: 16px; padding: 16px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.team.home { border-left: 6px solid var(--mh-blue); }
.team.away { border-left: 6px solid var(--mh-red); }

.team .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.team .name { font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team .score { font-size: 48px; font-weight: 700; min-width: 1.5em; text-align: right; }

.edit-away { background: transparent; color: var(--mh-blue); padding: 4px 8px; font-size: 14px; text-decoration: underline; }
.drawer { display: flex; gap: 8px; padding: 12px 0; flex-wrap: wrap; }
.drawer input, .drawer select { padding: 12px; font-size: 16px; border-radius: 8px; border: 1px solid #ccc; flex: 1; }
.drawer button { padding: 12px 16px; background: var(--mh-blue); color: white; }

.actions { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.btn-up { background: var(--mh-blue); color: white; padding: 24px; font-size: 28px; min-height: 88px; }
.btn-down { background: #e8e8ec; color: #333; padding: 16px; font-size: 20px; min-height: 56px; }

.formats, .periods, .clock-box {
  background: white; border-radius: 16px; padding: 16px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.formats h2, .periods h2, .clock-box h2 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: #888; }
.format-buttons { display: flex; gap: 8px; }
.format-buttons button { flex: 1; padding: 14px; min-height: 52px; background: #e8e8ec; color: #333; font-size: 15px; font-weight: 700; }
.format-buttons button.active { background: var(--mh-blue); color: white; }
.clock-box h2 .tabular { color: #1a1a1a; font-size: 32px; font-weight: 700; float: right; }

.period-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.period-buttons button { padding: 12px 16px; min-height: 48px; min-width: 64px; background: #e8e8ec; color: #333; font-size: 16px; }
.period-buttons button.active { background: var(--mh-red); color: white; }

.clock-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.clock-actions button { padding: 16px; font-size: 18px; background: var(--mh-blue); color: white; min-height: 56px; }
#clock-reset { background: #e8e8ec; color: #333; }

.clock-steppers { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.clock-steppers button { padding: 10px; font-size: 14px; background: #e8e8ec; color: #333; min-height: 44px; font-weight: 700; }

footer { padding: 16px 4px; display: flex; flex-direction: column; gap: 12px; }
#undo { width: 100%; padding: 16px; background: #444; color: white; font-size: 16px; min-height: 56px; }
.match-reset { width: 100%; padding: 14px; background: white; color: var(--mh-red); border: 2px solid var(--mh-red); font-size: 15px; min-height: 52px; font-weight: 700; }

.status { position: fixed; top: 12px; left: 12px; right: 12px; background: var(--mh-red); color: white; padding: 8px 12px; border-radius: 8px; text-align: center; font-size: 14px; }
