/* AI CONTEXT: Entries (station-1) Styles
   PURPOSE: Chance + zone-entry action buttons and the full-screen player picker
   DEPENDENCIES: common.css, index.css
   PATTERNS: Component-scoped CSS, big touch targets for live tagging */

/* ── Action buttons (Szansa + zones) ────────────────────────────────── */
.entries-section { display: flex; flex-direction: column; gap: 15px; }
.zone-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }

.entry-action {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 22px 15px; border: none; border-radius: 10px; cursor: pointer;
    color: #fff; background: #3f51b5; transition: background 0.15s, transform 0.05s;
    min-height: 90px;
}
.entry-action:hover { background: #303f9f; }
.entry-action:active { transform: scale(0.98); }
.entry-action-label { font-size: 1.35em; font-weight: 700; }
.entry-action-count { font-size: 1.6em; font-weight: 800; background: rgba(255,255,255,0.2); border-radius: 8px; padding: 2px 14px; min-width: 40px; }
.entry-action.chance { background: #00897b; }
.entry-action.chance:hover { background: #00695c; }
.entry-action.zone { background: #3f51b5; }

/* ── Full-screen entry overlay ──────────────────────────────────────── */
#entry-overlay {
    position: fixed; inset: 0; z-index: 1800;
    background: rgba(10, 14, 34, 0.92); backdrop-filter: blur(4px);
    display: none; align-items: stretch; justify-content: center;
}
.entry-overlay-inner {
    width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px;
    display: flex; flex-direction: column; gap: 20px;
    /* Flex items default to min-height:auto, so without this the inner box grows
       to its content instead of to the overlay — nothing below the fold can be
       reached, because a position:fixed overlay doesn't scroll with the page. */
    min-height: 0;
}
/* The scroll lives here, not on .player-grid: every step (skład, sektory,
   potwierdzenie) can overflow a short screen, and keeping the head outside the
   scroller means "✕ Anuluj" stays reachable no matter how long the roster is. */
#entry-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.entry-overlay-head { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.entry-overlay-head h2 { color: #fff; margin: 0; font-size: 2em; }
.entry-cancel {
    background: #ef5350; color: #fff; border: none; border-radius: 8px;
    padding: 12px 20px; font-size: 1.1em; cursor: pointer;
}
.entry-cancel:hover { background: #e53935; }
.entry-step-title { color: #cdd3f0; font-size: 1.4em; text-align: center; margin: 0 0 10px; }
.entry-step-hint { color: #8b93b8; font-size: 0.9em; text-align: center; margin: 0 0 14px; }
.entry-empty { color: #fff; text-align: center; font-size: 1.2em; }
.entry-empty a { color: #90caf9; }

/* ── Carry / Pass choice ────────────────────────────────────────────── */
.entry-action-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.choice-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: 60px 20px; border: none; border-radius: 16px; cursor: pointer; color: #fff;
    transition: transform 0.05s, filter 0.15s;
}
.choice-btn:hover { filter: brightness(1.1); }
.choice-btn:active { transform: scale(0.98); }
.choice-carry { background: #3949ab; }
.choice-pass  { background: #00897b; }
.choice-big { font-size: 2.6em; font-weight: 800; }
.choice-sub { font-size: 1.1em; opacity: 0.85; }

/* ── Player grid (big photos) ───────────────────────────────────────── */
.player-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px; padding: 4px; align-content: start;
}
.player-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: #fff; border: 3px solid transparent; border-radius: 14px;
    padding: 14px 10px; cursor: pointer; transition: border-color 0.12s, transform 0.05s;
}
.player-card:hover { border-color: #ffca28; }
.player-card:active { transform: scale(0.97); }
.player-card.static { cursor: default; }
.player-photo {
    width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
    background: #e8eaf6; display: flex; align-items: center; justify-content: center;
}
.player-photo-empty { font-size: 2.6em; font-weight: 800; color: #3f51b5; }

/* „Mydło" — karta nierozpoznanego zawodnika, zawsze pierwsza w siatce.
   Przerywana ramka, żeby na pierwszy rzut oka nie wyglądała jak zawodnik. */
.unknown-card { background: #fff8e1; border-color: #ffca28; border-style: dashed; }
.unknown-card:hover { border-color: #ffa000; }
.unknown-card .player-photo-empty { background: #ffecb3; color: #f57c00; }
.unknown-card .player-num, .unknown-card .player-name { color: #8d6e00; }

/* Edycja wpisu: „.current" oznacza wybór z pierwotnego otagowania, żeby było
   widać co się zmienia. Pierścień zamiast ramki — ramka niesie już hover. */
.player-card.current, .sector-btn.current, .choice-btn.current { box-shadow: 0 0 0 4px #ffca28; }
.player-num { font-size: 1.3em; font-weight: 800; color: #1a237e; }
.player-name { font-size: 1.05em; color: #333; text-align: center; line-height: 1.15; }

/* ── Sector grid (5 vertical channels) ──────────────────────────────── */
.sector-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 20px; }
.sector-btn {
    padding: 34px 10px; border: none; border-radius: 12px; cursor: pointer;
    background: #5c6bc0; color: #fff; font-size: 1.15em; font-weight: 700;
    transition: background 0.15s, transform 0.05s;
}
.sector-btn:hover { background: #3f51b5; }
.sector-btn:active { transform: scale(0.97); }

/* ── Pass confirm ───────────────────────────────────────────────────── */
.entry-confirm { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 30px; }
.confirm-pair { display: flex; align-items: center; gap: 30px; }
.confirm-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sector-badge {
    background: #ffca28; color: #1a237e; font-weight: 800;
    padding: 5px 16px; border-radius: 8px; font-size: 1.05em;
}
.confirm-arrow { font-size: 3em; color: #ffca28; font-weight: 800; }
.confirm-actions { display: flex; gap: 20px; }
.confirm-accept, .confirm-back {
    padding: 18px 44px; font-size: 1.4em; font-weight: 700;
    border: none; border-radius: 12px; cursor: pointer; color: #fff;
}
.confirm-accept { background: #43a047; }
.confirm-accept:hover { background: #388e3c; }
.confirm-back { background: #607d8b; }
.confirm-back:hover { background: #546e7a; }

@media (max-width: 640px) {
    .entry-overlay-inner { padding: 12px; gap: 12px; }
    .entry-overlay-head h2 { font-size: 1.4em; }
    .entry-action-choice { grid-template-columns: 1fr; }
    /* Narrower columns so a 26-man roster is ~9 rows of scroll, not 13 */
    .player-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
    .player-card { padding: 10px 6px; gap: 6px; }
    .player-photo { width: 72px; height: 72px; }
    .player-name { font-size: 0.9em; }
    .sector-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Niski ekran (telefon w poziomie: ~844x390) omija próg max-width powyżej —
   szerokości jest aż nadto, brakuje wysokości. Bez tego jeden rząd kart
   zajmuje ponad połowę widoku i scroll robi się nieskończony. */
@media (max-height: 500px) {
    .entry-overlay-inner { padding: 10px; gap: 8px; }
    .entry-overlay-head h2 { font-size: 1.3em; }
    .entry-cancel { padding: 8px 14px; font-size: 1em; }
    .entry-step-title { font-size: 1.1em; margin-bottom: 4px; }
    .entry-step-hint { margin-bottom: 6px; }
    .player-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
    .player-card { padding: 8px 6px; gap: 4px; }
    .player-photo { width: 60px; height: 60px; }
    .player-num { font-size: 1.1em; }
    .player-name { font-size: 0.85em; }
    .entry-action-choice { margin-top: 12px; }
    .choice-btn { padding: 26px 16px; }
    .choice-big { font-size: 1.8em; }
}
