/* ==========================================================================
   Admin - the control desk
   Built for someone standing at a laptop mid-match: large hit targets, state
   legible at a glance, nothing more than one click away.
   ========================================================================== */

body {
  background: #070a14;
  min-height: 100%;
  overflow-y: auto;
}

/* Oswald defaults light; pin the display-face elements to bold in one place. */
.admin__brand h1,
.team-card__name,
.team-card__score,
.clock-readout,
.modal__title,
.event-card__name,
.event-card--new .plus {
  font-weight: 700;
}

.admin {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 28px) 64px;
}

/* ------------------------------------------------------------------- bar */

/* Control-desk header, styled as the deck's navy band with the crimson rule. */
.admin__bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px clamp(12px, 2vw, 20px);
  margin: -18px calc(-1 * clamp(12px, 2vw, 28px)) 18px;
  background: var(--rb-navy-band);
}

.admin__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.admin__brand .rb-tick {
  height: 1.05em;
  align-self: center;
}

.admin__brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: -0.01em;
}

.admin__brand .tagline {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
}

/* ---------------------------------------------------------------- panels */

.admin__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1080px) {
  .admin__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin__main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin__side {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 78px;
}

@media (max-width: 1080px) {
  .admin__side {
    position: static;
  }
}

.panel {
  background: linear-gradient(168deg, rgba(16, 24, 48, 0.92), rgba(9, 13, 27, 0.92));
  border: 1px solid rgba(199, 202, 214, 0.11);
  border-radius: var(--r-lg);
  padding: 18px;
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel__title {
  margin: 0;
  position: relative;
  padding-left: 14px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rb-silver);
}

/* Crimson marker before each section title - the deck's accent-on-heading. */
.panel__title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--rb-red);
}

:root.is-rtl .panel__title { padding-left: 0; padding-right: 14px; }
:root.is-rtl .panel__title::before { left: auto; right: 0; }

.panel__note {
  font-size: 0.72rem;
  color: var(--rb-silver-dim);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.62em 1.15em;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(199, 202, 214, 0.16);
  color: var(--cream);
  transition: transform 0.12s var(--ease-out), background 0.16s, border-color 0.16s, opacity 0.16s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.13);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.btn--red {
  background: var(--rb-red);
  border-color: transparent;
}
.btn--red:hover:not(:disabled) {
  background: #ff2540;
}

.btn--go {
  background: var(--ok);
  border-color: transparent;
  color: #04210f;
}
.btn--go:hover:not(:disabled) {
  background: #2ee59c;
}

.btn--gold {
  background: var(--rb-yellow);
  border-color: transparent;
  color: var(--ink);
}
.btn--gold:hover:not(:disabled) {
  background: #ffd83f;
}

.btn--lg {
  padding: 0.8em 1.5em;
  font-size: 0.95rem;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  padding: 0.62em 0.8em;
}

/* --------------------------------------------------------------- scoring */

.teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 620px) {
  .teams {
    grid-template-columns: 1fr;
  }
}

.team-card {
  --accent: var(--rb-red);
  position: relative;
  border-radius: var(--r-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(199, 202, 214, 0.12);
  border-top: 4px solid var(--accent);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.team-card__id {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Native colour input, styled as a tappable swatch. Clicking it opens the OS
   colour picker; the chosen colour drives the team's crest ring and name rule
   on the display. */
.team-card__swatch {
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 9px;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.12s var(--ease-out), box-shadow 0.16s;
}

.team-card__swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

/* Fill the whole control with the current colour (strip the native chrome). */
.team-card__swatch::-webkit-color-swatch-wrapper { padding: 0; }
.team-card__swatch::-webkit-color-swatch { border: none; border-radius: 6px; }
.team-card__swatch::-moz-color-swatch { border: none; border-radius: 6px; }

.team-card__swatch-hint {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
  white-space: nowrap;
}

.team-card__name {
  flex: 1;
  min-width: 0;
  padding: 0.5em 0.7em;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(199, 202, 214, 0.14);
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.team-card__score {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 5.4rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  transition: transform 0.24s var(--ease-slam);
}

.team-card__score.bump {
  animation: score-bump 0.5s var(--ease-slam);
  color: var(--rb-yellow);
}

@keyframes score-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}

.team-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.team-card__hint {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
}

/* ----------------------------------------------------------------- clock */

.clock-panel {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.clock-readout {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 10vw, 5.6rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}

.clock-readout.is-urgent {
  color: var(--rb-red-glow);
}

.clock-state {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.clock-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.duration-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 14px;
  border-top: 1px solid rgba(199, 202, 214, 0.1);
  width: 100%;
}

.field-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
}

.input {
  width: 78px;
  padding: 0.55em 0.7em;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(199, 202, 214, 0.16);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.preset-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 0.42em 0.8em;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(199, 202, 214, 0.14);
  transition: background 0.15s, border-color 0.15s;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.chip-btn[aria-pressed='true'] {
  background: var(--rb-red);
  border-color: transparent;
}

/* ---------------------------------------------------------------- events */

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.event-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 12px 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(199, 202, 214, 0.12);
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease-out);
}

.event-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.event-card.is-live {
  border-color: var(--rb-red);
  background: rgba(225, 18, 61, 0.12);
  box-shadow: 0 0 0 1px var(--rb-red), 0 0 34px -8px var(--rb-red);
}

.event-card.is-disabled {
  opacity: 0.34;
  filter: grayscale(1);
}

.event-card__art {
  width: 100%;
  max-width: 118px;
  transition: transform 0.2s var(--ease-out);
}

.event-card:hover .event-card__art {
  transform: scale(1.05) rotate(-2deg);
}

.event-card__art svg {
  width: 100%;
  height: auto;
  display: block;
}

.event-card__meta {
  text-align: center;
  display: grid;
  gap: 2px;
}

.event-card__dur {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
}

.event-card__row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.event-card__row .btn {
  flex: 1;
  padding: 0.5em 0.6em;
  font-size: 0.74rem;
}

.event-card__live-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0.24em 0.6em;
  border-radius: var(--r-pill);
  background: var(--rb-red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ auto */

.auto-panel {
  display: grid;
  gap: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  flex: none;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(199, 202, 214, 0.18);
  transition: background 0.2s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream);
  transition: transform 0.22s var(--ease-out);
}

.switch[aria-checked='true'] {
  background: var(--ok);
  border-color: transparent;
}

.switch[aria-checked='true']::after {
  transform: translateX(24px);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-row .input {
  width: 68px;
}

.auto-next {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.78rem;
  color: var(--rb-silver);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.auto-next strong {
  color: var(--rb-yellow);
}

/* ------------------------------------------------------------------- log */

.log {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.log::-webkit-scrollbar {
  width: 6px;
}
.log::-webkit-scrollbar-thumb {
  background: rgba(199, 202, 214, 0.22);
  border-radius: 3px;
}

.log__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  border-left: 3px solid var(--rb-silver-dim);
}

.log__row[data-kind='goal'] {
  border-left-color: var(--ok);
}
.log__row[data-kind='event'] {
  border-left-color: var(--rb-yellow);
}
.log__row[data-kind='match'] {
  border-left-color: var(--rb-red);
}

.log__time {
  font-variant-numeric: tabular-nums;
  color: var(--rb-silver-dim);
  font-size: 0.72rem;
  flex: none;
}

.log__empty {
  padding: 18px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--rb-silver-dim);
}

/* -------------------------------------------------------------- shortcuts */

.shortcuts {
  display: grid;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--rb-silver);
}

.shortcuts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(199, 202, 214, 0.2);
  border-bottom-width: 2px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

/* Toast confirmation for actions that have no obvious local feedback */
.toast-stack {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}

.toast {
  padding: 0.65em 1.3em;
  border-radius: var(--r-pill);
  background: rgba(4, 10, 31, 0.95);
  border: 1px solid var(--rb-red);
  color: var(--cream);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: toast-cycle 2.4s ease-out both;
}

@keyframes toast-cycle {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  10%,
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ------------------------------------------------------------ event editor */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 14, 0.78);
  backdrop-filter: blur(3px);
}

.modal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--r-lg);
  background: linear-gradient(168deg, #131c38, #0a0f21);
  border: 1px solid rgba(199, 202, 214, 0.16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modal-in 0.24s var(--ease-out) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(199, 202, 214, 0.12);
}

.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.modal__close {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--rb-silver);
  background: rgba(255, 255, 255, 0.07);
}

.modal__close:hover {
  background: var(--rb-red);
  color: #fff;
}

.modal__body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  padding: 20px;
}

@media (max-width: 640px) {
  .modal__body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.modal__preview {
  display: grid;
  justify-items: center;
  gap: 10px;
  align-content: start;
}

.modal__badge {
  width: 100%;
  max-width: 175px;
}

.modal__badge svg {
  width: 100%;
  height: auto;
  display: block;
}

.modal__fields {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
}

.field__label em,
.req {
  font-style: normal;
  font-size: 0.92em;
  letter-spacing: 0.06em;
  color: var(--rb-silver-dim);
  opacity: 0.75;
}

.field__label .req {
  color: var(--rb-red-glow);
  opacity: 1;
}

.field__input {
  width: 100%;
  padding: 0.62em 0.8em;
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(199, 202, 214, 0.16);
  color: var(--cream);
  text-transform: uppercase;
}

#evTagline {
  text-transform: none;
}

.field__input--sm {
  width: 96px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.field__input.is-invalid {
  border-color: var(--bad);
  background: rgba(255, 77, 94, 0.1);
}

.field__inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field__hint {
  font-size: 0.72rem;
  color: var(--rb-silver-dim);
  line-height: 1.4;
}

.field__hint.is-error {
  color: var(--bad);
}

.tone-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tone-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.15s var(--ease-out), border-color 0.15s;
}

.tone-swatch:hover {
  transform: translateY(-2px);
}

.tone-swatch[aria-pressed='true'] {
  border-color: var(--cream);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.modal__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(199, 202, 214, 0.12);
}

.modal__foot-right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.btn--danger {
  background: rgba(232, 17, 45, 0.16);
  border-color: rgba(232, 17, 45, 0.5);
  color: #ff8d9c;
}

.btn--danger:hover:not(:disabled) {
  background: var(--rb-red);
  color: #fff;
}

/* Edit affordance on each event tile */
.event-card__edit {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  background: rgba(4, 10, 31, 0.82);
  border: 1px solid rgba(199, 202, 214, 0.26);
  color: var(--rb-silver);
  opacity: 0;
  transition: opacity 0.16s, background 0.16s, color 0.16s;
}

.event-card:hover .event-card__edit,
.event-card__edit:focus-visible {
  opacity: 1;
}

.event-card__edit:hover {
  background: var(--rb-yellow);
  color: var(--ink);
}

.event-card__tagline {
  font-size: 0.66rem;
  color: var(--rb-silver-dim);
  line-height: 1.3;
}

/* Tile that opens the editor for a brand new event */
.event-card--new {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 210px;
  border-style: dashed;
  border-color: rgba(199, 202, 214, 0.28);
  color: var(--rb-silver);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.event-card--new:hover {
  border-color: var(--rb-red);
  color: var(--cream);
}

/* The deck's plus motif, rendered as a crimson disc. */
.event-card--new .plus {
  display: grid;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  background: var(--rb-red);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  font-family: var(--font-display);
  transition: transform 0.15s var(--ease-out);
}

.event-card--new:hover .plus {
  transform: scale(1.08);
}

/* Danger zone gets visual separation so nobody hits it by accident. */
.danger-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px dashed rgba(232, 17, 45, 0.34);
  width: 100%;
}

/* ==========================================================================
   Additions: event-card chips, announcer, RTL, phone
   ========================================================================== */

/* Duration chip, top corner of each event card. */
.event-card__time {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  right: auto;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--rb-navy-band);
  border: 1px solid rgba(199, 202, 214, 0.3);
  color: var(--cream);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}

/* Edit pencil sits in the opposite corner, and flips under RTL. */
.event-card__edit {
  left: auto;
  right: auto;
  inset-inline-start: 8px;
}

.event-card__name {
  font-family: var(--font-display);
  font-size: 0.82rem;
  line-height: 1.05;
  color: var(--cream);
}

.event-card__tagline {
  font-size: 0.66rem;
  color: var(--rb-silver-dim);
  line-height: 1.3;
  margin-top: 2px;
  /* Two lines is enough for the operator to know what it does. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card__key {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rb-silver-dim);
  margin-top: 3px;
}

/* ------------------------------------------------------------------- RTL */

:root.is-rtl body { direction: rtl; }
:root.is-rtl .admin__brand { margin-right: 0; margin-left: auto; }
:root.is-rtl .field-label[style*='margin-left'] { margin-left: 0 !important; margin-right: auto; }
/* Numbers/inputs read left-to-right even in an Arabic layout. */
:root.is-rtl .input,
:root.is-rtl .clock-readout,
:root.is-rtl .team-card__score,
:root.is-rtl .log__time { direction: ltr; }
:root.is-rtl .team-card__name { text-align: right; }

/* --------------------------------------------------------------- phone */

@media (max-width: 640px) {
  .admin { padding: 12px 10px 48px; }
  .admin__bar { gap: 8px; margin: -12px -10px 12px; padding: 10px; }
  .admin__brand h1 { font-size: 1rem; }
  .admin__brand .tagline { display: none; }
  .admin__bar .btn { padding: 0.5em 0.8em; font-size: 0.72rem; }

  .teams { grid-template-columns: 1fr; }
  .team-card__score { font-size: 3.4rem; }

  .clock-readout { font-size: 3rem; }
  .clock-controls .btn { flex: 1; }
  .duration-row { justify-content: center; }

  .event-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
  .event-card__art { max-width: 88px; }
  .event-card__row .btn { font-size: 0.68rem; padding: 0.45em 0.4em; }

  .modal__body { grid-template-columns: minmax(0, 1fr); }
  .modal__preview { order: -1; }
  .modal__badge { max-width: 130px; }
}

/* Comfortable tap targets on any touch device. */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .chip-btn { min-height: 34px; }
}

/* Two-up fields in the event editor (title EN/AR, description EN/AR). */
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field__input--ar { text-align: right; }
:root.is-rtl .field__input--ar { text-align: right; }
@media (max-width: 640px) {
  .field-pair { grid-template-columns: 1fr; }
}
