/* Explain: Styles for various game components, UI elements, and visual effects. */
.site-header {
    background: rgba(11, 9, 10, 0.86);
    backdrop-filter: blur(18px);
}

.glass-panel {
    border: 1px solid var(--glass-border);
    background: linear-gradient(145deg, rgba(22, 26, 29, 0.78), rgba(0, 0, 0, 0.48));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.sound-btn {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sound-btn:active .rounded-full {
    transform: scale(0.9);
    background-color: var(--primary-hover);
}

.sound-btn.is-playing {
    background-color: var(--primary-color) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 3px var(--accent-color), 0 0 26px rgba(212, 175, 55, 0.55) !important;
}

.sound-btn.is-playing .rounded-full {
    background-color: var(--accent-color) !important;
    box-shadow: 0 0 22px var(--accent-color) !important;
}

.sound-btn.is-playing span {
    color: #ffffff !important;
}

.water-drop-btn {
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.4)), var(--glass-bg);
    box-shadow:
        inset 10px 20px 30px rgba(0,0,0,0.5),
        10px 10px 30px rgba(0,0,0,0.5),
        inset -5px -5px 15px rgba(255,255,255,0.1);
    -webkit-tap-highlight-color: transparent;
}

.water-drop-btn::before {
    content: "";
    position: absolute;
    top: 10%;
    left: 20%;
    width: 30%;
    height: 20%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: rotate(-45deg);
    filter: blur(2px);
    z-index: 5;
    pointer-events: none;
}

.water-drop-btn:active, .water-drop-btn:hover {
    animation: water-morph 0.6s ease-in-out infinite alternate;
    transform: scale(0.96);
}

@keyframes water-morph {
    0% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* Botón 3D tipo gema pulida (acceso a NBW) */
.gem-float {
    animation: gem-float 5s ease-in-out infinite;
}

@keyframes gem-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.gem-btn {
    overflow: hidden;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 42%),
        radial-gradient(circle at 72% 82%, rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 0) 58%),
        radial-gradient(circle at 50% 42%, var(--primary-hover), var(--primary-color) 58%, #4d0f0f 100%);
    box-shadow:
        inset 0 7px 16px rgba(255, 255, 255, 0.4),
        inset 0 -16px 30px rgba(0, 0, 0, 0.65),
        inset 0 0 24px rgba(212, 175, 55, 0.35),
        0 18px 34px rgba(0, 0, 0, 0.75),
        0 0 0 2px rgba(212, 175, 55, 0.55),
        0 0 34px rgba(212, 175, 55, 0.3);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
    -webkit-tap-highlight-color: transparent;
}

.gem-btn::before {
    content: "";
    position: absolute;
    top: 6%;
    left: 18%;
    width: 46%;
    height: 32%;
    border-radius: 50%;
    background: radial-gradient(circle at 42% 38%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 72%);
    filter: blur(2px);
    pointer-events: none;
}

.gem-btn::after {
    content: "";
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    box-shadow: inset 0 0 18px rgba(212, 175, 55, 0.7);
    pointer-events: none;
}

.gem-btn:hover,
.gem-btn:focus-visible {
    transform: translateY(-8px) scale(1.07);
    box-shadow:
        inset 0 9px 20px rgba(255, 255, 255, 0.5),
        inset 0 -18px 32px rgba(0, 0, 0, 0.6),
        inset 0 0 26px rgba(212, 175, 55, 0.5),
        0 28px 48px rgba(0, 0, 0, 0.8),
        0 0 0 2px var(--accent-color),
        0 0 48px rgba(212, 175, 55, 0.7);
}

.gem-btn:active {
    transform: translateY(-2px) scale(0.98);
}

/* Selector de tipo de mérito (MCI / MCC) */
.calc-option {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.calc-option:hover {
    border-color: var(--primary-color) !important;
    transform: translateY(-2px);
}

.calc-option[aria-pressed="true"] {
    background: var(--primary-color) !important;
    border-color: var(--accent-color) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px var(--accent-color), var(--shadow-button);
}

.calc-hidden {
    display: none !important;
}

/* Botón de acceso a DAGOL (imagen adjunta) */
.dagol-btn {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
    -webkit-tap-highlight-color: transparent;
}

.dagol-btn:hover,
.dagol-btn:focus-visible {
    transform: translateY(-8px) scale(1.06);
    filter: drop-shadow(0 0 26px rgba(212, 175, 55, 0.6));
}

.dagol-btn:active {
    transform: translateY(-2px) scale(0.98);
}

/* Mini Campo de Fútbol para las posiciones */
.pitch-mini {
    position: relative;
    width: 36px;
    height: 52px;
    background-color: rgba(46, 125, 50, 0.4);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 3px;
    overflow: hidden;
}
.pitch-mini::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.4);
    transform: translateY(-50%);
}
.pitch-mini::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.pitch-area-top, .pitch-area-bottom {
    position: absolute;
    width: 18px;
    height: 6px;
    border: 1px solid rgba(255,255,255,0.4);
    left: 50%;
    transform: translateX(-50%);
}
.pitch-area-top { top: 0; border-top: none; }
.pitch-area-bottom { bottom: 0; border-bottom: none; }
.pitch-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #f5c518;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 3px rgba(0,0,0,0.8);
    z-index: 10;
}

.pitch-dot--active {
    width: 9px;
    height: 9px;
    background: #ef4444;
    z-index: 11;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.9);
}

/* Dado 3D */
.dice-scene {
    width: 150px;
    height: 150px;
    perspective: 800px;
    margin: 2rem auto;
}
.dice-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}
.dice-face {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(120% 95% at 27% 16%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 44%),
        radial-gradient(130% 120% at 72% 98%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 52%),
        linear-gradient(155deg, #3d434b 0%, #1b1f24 55%, #0a0b0d 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.35),
        inset 0 -12px 20px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.07),
        inset 0 0 26px rgba(0, 0, 0, 0.35),
        0 8px 18px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    padding: 0;
    color: var(--text-color);
    word-break: break-word;
    transition: color 0.3s ease, box-shadow 0.3s ease;
    backface-visibility: hidden;
}
.dice-face--1 { transform: rotateY(  0deg) translateZ(75px); }
.dice-face--2 { transform: rotateY( 90deg) translateZ(75px); }
.dice-face--3 { transform: rotateY(180deg) translateZ(75px); }
.dice-face--4 { transform: rotateY(-90deg) translateZ(75px); }
.dice-face--5 { transform: rotateX( 90deg) translateZ(75px); }
.dice-face--6 { transform: rotateX(-90deg) translateZ(75px); }

/* Superficie plástica (NBW) */
.dice-cube.dice-blue .dice-face {
    background:
        radial-gradient(120% 95% at 27% 16%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 46%),
        radial-gradient(130% 120% at 72% 98%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 52%),
        linear-gradient(155deg, #4b93f7 0%, #1e3a8a 55%, #0d1c45 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.45),
        inset 0 -12px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 26px rgba(10, 20, 60, 0.4),
        0 8px 18px rgba(0, 0, 0, 0.55);
}
.dice-cube.dice-red .dice-face {
    background:
        radial-gradient(120% 95% at 27% 16%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 46%),
        radial-gradient(130% 120% at 72% 98%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 52%),
        linear-gradient(155deg, #ef5350 0%, #991b1b 55%, #450a0a 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.45),
        inset 0 -12px 20px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 0 26px rgba(80, 10, 10, 0.4),
        0 8px 18px rgba(0, 0, 0, 0.55);
}
.dice-cube.dice-grey .dice-face {
    background:
        radial-gradient(120% 95% at 27% 16%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 46%),
        radial-gradient(130% 120% at 72% 98%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 52%),
        linear-gradient(155deg, #9ca3af 0%, #4b5563 55%, #1f2937 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.5),
        inset 0 -12px 20px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 0 26px rgba(20, 25, 35, 0.35),
        0 8px 18px rgba(0, 0, 0, 0.5);
}
.dice-cube.dice-black .dice-face {
    background:
        radial-gradient(120% 95% at 27% 16%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 44%),
        radial-gradient(130% 120% at 72% 98%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 52%),
        linear-gradient(155deg, #2b3038 0%, #111827 55%, #000000 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.25),
        inset 0 -12px 20px rgba(0, 0, 0, 0.7),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 0 26px rgba(0, 0, 0, 0.6),
        0 8px 18px rgba(0, 0, 0, 0.6);
}
.dice-cube.dice-brown .dice-face {
    background:
        radial-gradient(120% 95% at 27% 16%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 46%),
        radial-gradient(130% 120% at 72% 98%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 52%),
        linear-gradient(155deg, #b07c52 0%, #6b4226 55%, #2e1c0f 100%);
    box-shadow:
        inset 0 2px 2px rgba(255, 255, 255, 0.4),
        inset 0 -12px 20px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 0 26px rgba(60, 35, 15, 0.4),
        0 8px 18px rgba(0, 0, 0, 0.55);
}
.face-icon {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 6px !important;
    pointer-events: none !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85)) !important;
}

/* Moneda de la Última Oportunidad (oro viejo) */
.coin-scene {
    width: 190px;
    height: 190px;
    perspective: 900px;
    margin: 2rem auto;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    backface-visibility: hidden;
    border: 5px solid #8a6c1a;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 248, 214, 0.9), rgba(255, 248, 214, 0) 44%),
        radial-gradient(circle at 68% 82%, rgba(120, 92, 28, 0.55), rgba(120, 92, 28, 0) 60%),
        radial-gradient(circle at 50% 50%, #d8b75e 0%, #b08a2e 48%, #7a5c18 100%);
    box-shadow:
        inset 0 0 0 3px rgba(255, 240, 190, 0.35),
        inset 0 8px 16px rgba(255, 245, 205, 0.5),
        inset 0 -12px 22px rgba(58, 40, 8, 0.65),
        0 10px 22px rgba(0, 0, 0, 0.6);
    color: #3d2c08;
    font-family: var(--font-heading);
}

.coin-face--front { transform: rotateY(0deg); }
.coin-face--back { transform: rotateY(180deg); }

.coin-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.coin-face-text {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3d2c08;
    text-shadow: 0 1px 1px rgba(255, 248, 214, 0.6);
}

/* Aviso de medalla en la Calculadora de Daños (NBW) */
@keyframes medal-pop {
    0% { transform: scale(0.6); opacity: 0; }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}

.medal-pop {
    animation: medal-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Aviso vistoso de victoria por la Moneda de Última Oportunidad */
.coin-victory-banner {
    border: 3px solid var(--accent-color);
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0) 70%),
        linear-gradient(145deg, var(--primary-color), #4d0f0f);
    box-shadow:
        0 0 0 2px rgba(212, 175, 55, 0.45),
        0 12px 40px rgba(0, 0, 0, 0.7),
        0 0 48px rgba(212, 175, 55, 0.55);
    color: #ffffff;
    animation: coin-victory-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.coin-victory-banner i {
    color: var(--accent-color);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
}

.coin-victory-text {
    color: #ffffff;
    animation: coin-victory-glow 1.6s ease-in-out infinite alternate;
}

@keyframes coin-victory-pop {
    0% { transform: scale(0.5) rotate(-4deg); opacity: 0; }
    60% { transform: scale(1.06) rotate(1deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes coin-victory-glow {
    0% { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 12px rgba(212, 175, 55, 0.5); }
    100% { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 34px rgba(212, 175, 55, 1); }
}

/* Navegación entre las secciones locales del club (DAGOL, modo campeonato) */
.club-nav-btn[aria-pressed="true"] {
    border-color: var(--accent-color) !important;
    background: rgba(212, 175, 55, 0.16);
}

/* Contenedor y paneles del club gestionado (DAGOL). Un único origen para el estado visible,
   de modo que el panel activo siempre se imponga sobre el resto. */
.club-content,
.club-panel {
    display: none;
}

.club-content.is-active,
.club-panel.is-active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Mensajes de estado de los paneles locales del club */
.club-msg-ok {
    color: var(--accent-color) !important;
}

.club-msg-error {
    color: var(--primary-hover) !important;
}

/* Dado DAGOL: plástico realista, esquinas redondeadas y color elegible */
.dagol-die .dice-face {
    border-radius: 18%;
    background-color: var(--die-color, #6b7280);
    background-image:
        radial-gradient(120% 95% at 30% 16%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 52%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 42%, rgba(0, 0, 0, 0.35) 100%);
    box-shadow:
        inset 0 3px 3px rgba(255, 255, 255, 0.55),
        inset 0 -18px 28px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15),
        0 10px 22px rgba(0, 0, 0, 0.6);
}

.dagol-die .dice-face {
    font-size: 2.6rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

/* Dado de posesión ganador: destaca claramente sobre el otro (DAGOL) */
@keyframes possession-winner-glow {
    0% { filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.7)); }
    100% { filter: drop-shadow(0 0 28px rgba(212, 175, 55, 1)); }
}

.dice-winner {
    transform: scale(1.16);
    filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.9));
    animation: possession-winner-glow 1.1s ease-in-out infinite alternate;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
    z-index: 6;
}

.dice-loser {
    transform: scale(0.9);
    opacity: 0.45;
    filter: grayscale(0.55);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease, filter 0.45s ease;
}

/* Paneles y utilidades de la Resolución de ronda (DAGOL) */
.ronda-panel {
    display: none;
}

.ronda-panel.ronda-active {
    display: flex;
}

.ronda-hidden,
.ronda-hidden.ronda-hidden {
    display: none !important;
}

/* Capa a pantalla completa de la lesión por fatiga: el estado oculto (ronda-hidden)
   siempre manda sobre su presentación, igual que en el resto de overlays del juego. */
.fatiga-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    z-index: 75;
}

/* Sticker de GOL */
.gol-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 60;
}

.goal-sticker {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.1rem 2.6rem;
    border: 4px solid var(--accent-color);
    border-radius: 22px;
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 9vw, 5rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 0) 70%),
        linear-gradient(145deg, var(--primary-color), #4d0f0f);
    box-shadow:
        0 0 0 4px rgba(212, 175, 55, 0.35),
        0 18px 50px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(212, 175, 55, 0.7);
    opacity: 0;
    transform: scale(0.4) rotate(-6deg);
}

.goal-sticker i {
    color: var(--accent-color);
    font-size: clamp(2rem, 8vw, 4rem);
}

.goal-sticker--show {
    animation: goal-sticker-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes goal-sticker-pop {
    0% { transform: scale(0.4) rotate(-6deg); opacity: 0; }
    55% { transform: scale(1.12) rotate(2deg); opacity: 1; }
    75% { transform: scale(0.98) rotate(-1deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Sticker de GOL ANULADO (revisión VAR) */
.goal-sticker--annulled {
    border-color: #9ca3af;
    border-radius: 18px;
    font-size: clamp(1.4rem, 6vw, 3rem);
    max-width: 92vw;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(156, 163, 175, 0.45), rgba(156, 163, 175, 0) 70%),
        linear-gradient(145deg, var(--secondary-color), #14151f);
    box-shadow:
        0 0 0 4px rgba(156, 163, 175, 0.28),
        0 18px 50px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(156, 163, 175, 0.5);
}

.goal-sticker--annulled i {
    color: #d1d5db;
    font-size: clamp(1.6rem, 7vw, 3rem);
}

/* Sticker de disparo FUERA */
.goal-sticker--miss {
    border-color: #ef4444;
    background:
        radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0) 70%),
        linear-gradient(145deg, #7f1d1d, #3f0c0c);
    box-shadow:
        0 0 0 4px rgba(239, 68, 68, 0.35),
        0 18px 50px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(239, 68, 68, 0.6);
}

.goal-sticker--miss i {
    color: #fca5a5;
}

/* Plantilla bloqueada tras guardar: evita cualquier cambio en la alineación */
.squad-locked .player-label-cb {
    pointer-events: none;
    cursor: default;
    opacity: 0.9;
}

.squad-locked .player-cb {
    cursor: default;
}

/* La ficha del jugador (icono del ojo) sigue accesible aunque la plantilla esté guardada */
.squad-locked .jugador-eye {
    pointer-events: auto;
    cursor: pointer;
}

/* Sticker de gol con foto del goleador y contador de goles */
.goal-sticker-photo {
    width: clamp(3.2rem, 11vw, 5.4rem);
    height: clamp(3.2rem, 11vw, 5.4rem);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent-color);
    background: var(--surface-color);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
}

.goal-sticker-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.goal-sticker-photo i {
    font-size: clamp(1.3rem, 4.5vw, 2.2rem);
    color: var(--text-muted);
}

.goal-sticker-name {
    font-size: clamp(0.85rem, 3.2vw, 1.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    text-align: center;
}

.goal-sticker-count {
    font-size: clamp(0.7rem, 2.6vw, 1.1rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-color);
    text-align: center;
}

/* Sticker de PARADA del portero */
.goal-sticker--save {
    border-color: #43a047;
    background:
        radial-gradient(circle at 50% 0%, rgba(67, 160, 71, 0.55), rgba(67, 160, 71, 0) 70%),
        linear-gradient(145deg, #1b5e20, #0d3010);
    box-shadow:
        0 0 0 4px rgba(67, 160, 71, 0.35),
        0 18px 50px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(67, 160, 71, 0.7);
}

.goal-sticker--save i {
    color: #a5d6a7;
}

.goal-sticker--save .goal-sticker-photo {
    border-color: #a5d6a7;
}

/* Sticker de incidencia con el jugador afectado (tarjeta, expulsión o lesión) */
.goal-sticker-event {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.95rem, 3.6vw, 1.7rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    text-align: center;
}

.goal-sticker--card {
    border-color: var(--accent-color);
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.5), rgba(212, 175, 55, 0) 70%),
        linear-gradient(145deg, #b8860b, #6b4e0a);
}

.goal-sticker--red {
    border-color: #ef4444;
    background:
        radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.5), rgba(239, 68, 68, 0) 70%),
        linear-gradient(145deg, #991b1b, #450a0a);
}

.goal-sticker--injury {
    border-color: #f87171;
    background:
        radial-gradient(circle at 50% 0%, rgba(248, 113, 113, 0.45), rgba(248, 113, 113, 0) 70%),
        linear-gradient(145deg, #7f1d1d, #3f0c0c);
}

/* Dado natural de la disputa de posesión: cara marfil y números pintados en el color del equipo */
.dagol-die-numbered .dice-face {
    color: var(--die-number-color, #1a1614);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.45), 0 -1px 1px rgba(0, 0, 0, 0.25);
}

/* Escudo del equipo que gana la posesión, emerge al desaparecer los dados */
@keyframes poss-shield-pop {
    0% { transform: scale(0.4); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.poss-shield-pop {
    animation: poss-shield-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#possReveal img, .poss-shield-pop img {
    max-height: 56px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Aspa de empate: disputa de posesión sin vencedor → «Ronda sin eventos» */
@keyframes poss-tie-pop {
    0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
    60% { transform: scale(1.12) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.poss-tie-pop {
    animation: poss-tie-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Aviso de turno en partidos entre dos usuarios (DAGOL): capa a pantalla completa
   que solo aparece cuando la ronda le corresponde al rival. Usa clases propias del
   proyecto (sin utilidades con !important) para que el estado oculto siempre mande. */
/* Aviso de turno en partidos entre dos usuarios (DAGOL): banda compacta que NO tapa el
   partido; quien observa sigue viendo la jugada en directo. */
.turn-wait-overlay {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--accent-color);
    border-radius: 0.9rem;
    background: rgba(212, 175, 55, 0.12);
}

.turn-wait-overlay.turn-wait-show {
    display: flex;
}

.turn-wait-overlay .turn-wait-msg {
    flex: 1 1 14rem;
    min-width: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-color);
}

.turn-wait-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Quien no lleva la posesión no puede accionar los botones del partido, pero lo ve entero. */
.ronda-spectator .ronda-action,
.ronda-spectator #fasePosesion button,
.ronda-spectator #faseEventos button,
.ronda-spectator #faseTiros button,
.ronda-spectator #faseTiroPuerta button,
.ronda-spectator #faseLesion button,
.ronda-spectator #faseFin button {
    pointer-events: none !important;
    opacity: 0.45 !important;
}

.ronda-spectator .turn-wait-overlay {
    display: none !important;
}

/* Mientras el rival ajusta su táctica en la plantilla, el partido queda en pausa para el otro. */
.ronda-paused #btnPosesion,
.ronda-paused #btnEvento,
.ronda-paused #btnTiro,
.ronda-paused #btnTiroPuerta,
.ronda-paused #btnCartaContinuar,
.ronda-paused #btnLesionContinuar,
.ronda-paused #btnNuevaRonda,
.ronda-paused #btnResolverRonda,
.ronda-paused #btnGestionPartido {
    pointer-events: none;
    opacity: 0.45;
}

/* Banda de aviso: el rival está ajustando su táctica y su plantilla */
.rival-pause-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--accent-color);
    border-radius: 0.9rem;
    background: rgba(212, 175, 55, 0.12);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Retransmisión en directo del partido entre dos usuarios (lo que ve quien observa) */
.live-feed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 22rem;
    overflow-y: auto;
}

.live-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.78rem;
    color: var(--text-color);
}

.live-item.live-sep {
    justify-content: center;
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.14);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--accent-color);
}

.live-ico {
    color: var(--accent-color);
}

.live-die {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    font-weight: 900;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
}

.live-card-img {
    display: block;
    width: 100%;
    max-width: 16rem;
    height: auto;
    margin-top: 0.35rem;
    border: 1px solid var(--accent-color);
    border-radius: 0.7rem;
}

/* Plantilla del partido en modo lectura (táctica temporal desde el entrenador):
   los controles permanecen bloqueados hasta pulsar «Editar». */
.squad-readonly .player-label-cb {
    cursor: default;
}

.squad-readonly select[disabled] {
    opacity: 0.75;
}

.squad-readonly [data-target][disabled] {
    opacity: 0.5;
    cursor: default;
}

/* Rueda de Prensa (DAGOL): se muestra la imagen real de la sala, sin superposiciones. */

/* Lamparita de conexión (presencia en vivo) */
.presencia-host {
    position: relative;
}

.presencia-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: #22c55e;
    border: 2px solid var(--nav-bg);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 10px rgba(34, 197, 94, 0.85);
    z-index: 20;
    pointer-events: none;
}

.presencia-btn[data-presencia-online="0"] {
    opacity: 0.6;
}

.presencia-btn[data-presencia-online="0"] .presencia-ping-ring {
    opacity: 0.18;
}

.presencia-btn[data-presencia-online="1"] .presencia-ping-ring {
    animation: presencia-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes presencia-ping {
    75%, 100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* Línea de táctica del rival: cada bando ocupa su mitad (el local a la izquierda y el
   visitante a la derecha) y la píldora de táctica queda centrada en su propio lado.
   La llamada a plantilla y las estrellas del entrenador se pegan al borde exterior de la
   mitad que le corresponde al mánager. */
.tactic-half {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tactic-half .tactic-pill {
    margin-inline: auto;
}

/* Niebla de partido (DAGOL): la táctica del rival llega oculta al pitido inicial y solo se
   desvela cuando el entrenador acumula las rondas de lectura que le concede su nivel. Mientras
   no toca, su texto se pinta como una mancha de niebla: ilegible, pero con su forma. */
.tactic-pill--fog {
    position: relative;
    overflow: hidden;
}

.tactic-pill--fog .tactic-fog-text {
    color: transparent;
    text-shadow: 0 0 9px rgba(255, 255, 255, 0.92), 0 0 3px rgba(255, 255, 255, 0.65);
    user-select: none;
    pointer-events: none;
}

/* Capas de edición de los equipos de referencia (solo administrador).
   El estado oculto se controla con la clase propia del proyecto, no con utilidades. */
.ref-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    padding: 1rem;
}

.ref-overlay.is-open {
    display: flex;
}

/* Minimapa de demarcaciones de la plantilla base (equipos de referencia): algo más grande que
   el de la alineación y con los puntos pulsables para elegir la posición del jugador. */
.pitch-mini--ref {
    width: 60px;
    height: 88px;
}

.pitch-mini--ref .pitch-dot {
    width: 11px;
    height: 11px;
}

.pitch-mini--ref .pitch-dot--active {
    width: 15px;
    height: 15px;
}

.pitch-mini--ref .pitch-area-top,
.pitch-mini--ref .pitch-area-bottom {
    width: 30px;
    height: 10px;
}

.pitch-mini--ref::after {
    width: 20px;
    height: 20px;
}

button.pitch-dot {
    border: 0;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button.pitch-dot:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Pestañas y paneles de la ficha del club (Explorar equipos). Un único origen para el estado
   visible, de modo que el panel activo siempre se imponga sin conflictos de capas. */
.ref-tab {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
}

.ref-tab[aria-pressed="true"] {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.16);
    color: var(--accent-color);
}

.ref-panel {
    display: none;
    width: 100%;
}

.ref-panel.is-active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Dirección de carga del juego (pestaña Táctica de los equipos de referencia): gráfico del
   campo con tres franjas verticales pulsables. El estado activo y los marcadores del campo se
   controlan con clases propias del proyecto. */
.carga-pitch {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 3 / 4;
    margin: 0 auto;
    display: flex;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    overflow: hidden;
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 26px, rgba(0, 0, 0, 0.05) 26px 52px),
        linear-gradient(180deg, rgba(46, 125, 50, 0.4), rgba(27, 77, 30, 0.5));
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55);
}

.carga-pitch::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.carga-pitch::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.carga-zone {
    position: relative;
    flex: 1 1 0;
    border: 0;
    border-right: 1px dashed rgba(255, 255, 255, 0.28);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
}

.carga-zone:last-child { border-right: 0; }

.carga-zone:hover { background: rgba(255, 255, 255, 0.06); }

.carga-zone--active {
    background: rgba(212, 175, 55, 0.34);
    box-shadow: inset 0 0 0 2px var(--accent-color);
}

.carga-zone--readonly { cursor: default; }

.carga-zone-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.carga-zone--active .carga-zone-label { color: #ffffff; }

.carga-zone-mult {
    min-height: 1rem;
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.carga-pill {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.carga-pill:hover:not(:disabled) {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.carga-pill--active {
    color: #1a1614;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.carga-pill:disabled { cursor: default; opacity: 0.7; }

/* Iconos de estado en la ficha del jugador (DAGOL): forma física, lesión y diana
   (jugador designado como lanzador de faltas o penaltis). */
.pcard-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

/* Fila de indicadores de la ficha del jugador: iconos compactos bajo el nombre. */
.pcard-badges--row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.pcard-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 1.6rem;
    height: 1.6rem;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.42);
}

.pcard-badge i {
    font-size: 0.75rem;
}

.pcard-badge span.badge-num {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 999px;
    background: inherit;
    color: #1a1614;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 900;
    border: 1px solid var(--nav-bg);
    line-height: 1;
}

.pcard-badge--forma-ok { border-color: #22c55e; color: #4ade80; }
.pcard-badge--forma-ok .badge-num { background: #22c55e; color: #000; }
.pcard-badge--forma-warn { border-color: #eab308; color: #fde047; }
.pcard-badge--forma-warn .badge-num { background: #eab308; color: #000; }
.pcard-badge--forma-bad { border-color: #ef4444; color: #fca5a5; }
.pcard-badge--forma-bad .badge-num { background: #ef4444; color: #fff; }
.pcard-badge--injury { border-color: #ef4444; color: #fca5a5; background: rgba(239, 68, 68, 0.14); }
.pcard-badge--injury .badge-num { background: #ef4444; color: #fff; }
.pcard-badge--expulsado { border-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, 0.14); }
.pcard-badge--expulsado .badge-num { background: #ef4444; color: #fff; }
.pcard-badge--taker { border-color: var(--accent-color); color: var(--accent-color); background: rgba(212, 175, 55, 0.16); }
.pcard-badge--taker .badge-num { background: var(--accent-color); color: #000; }

/* Icono propio del lanzador (faltas y penaltis) dentro de la insignia de la ficha. */
.badge-ico-img {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    object-fit: contain;
}

/* Etiqueta de la mejora temporal de forma (entrenamiento) sobre la pila de forma. */
.pcard-badge-form-boost {
    position: absolute;
    bottom: -6px;
    right: -6px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--accent-color);
    color: #1a1614;
    font-size: 0.5rem;
    font-weight: 900;
    line-height: 1.2;
    border: 1px solid var(--nav-bg);
}

/* La fila de indicadores de la ficha nunca debe obligar a desplazarse: se ajusta sola. */
.pcard-badges--row {
    align-items: center;
    row-gap: 0.3rem;
    min-height: 0;
}

/* Ficha del jugador en el listado del club */
.club-pcard {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--glass-border);
    border-radius: 0.9rem;
    background: rgba(0, 0, 0, 0.32);
}

.club-pcard-photo {
    width: 3.1rem;
    height: 3.1rem;
    flex-shrink: 0;
    border-radius: 0.7rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.club-pcard-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.club-pcard-photo i {
    color: var(--text-muted);
    font-size: 1.3rem;
}

/* Aviso de arranque del partido (DAGOL): sustituye cualquier salto inesperado a la portada
   por un mensaje dentro de la app. El estado visible se controla con una clase propia. */
.match-guard-banner {
    position: fixed;
    top: 5.5rem;
    left: 50%;
    z-index: 140;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    width: min(92vw, 34rem);
    padding: 1.1rem 3.2rem 1.1rem 1.2rem;
    border: 1px solid var(--accent-color);
    border-radius: 1rem;
    background: var(--nav-bg);
    box-shadow: var(--shadow-soft);
    color: var(--text-color);
    transform: translateX(-50%);
}

.match-guard-banner.is-open {
    display: flex;
}

.match-guard-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.match-guard-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.match-guard-ref {
    margin: 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.match-guard-ref:empty {
    display: none;
}

.match-guard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.match-guard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: transparent;
    color: var(--accent-color);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.match-guard-btn:hover,
.match-guard-btn:focus-visible {
    background: var(--accent-color);
    color: var(--background-color);
    outline: none;
}

.match-guard-btn--primary {
    background: var(--accent-color);
    color: var(--background-color);
}

.match-guard-btn--primary:hover,
.match-guard-btn--primary:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
}

.match-guard-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.match-guard-close:hover,
.match-guard-close:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

/* Menú de navegación persistente de DAGOL: barra bajo la cabecera con la página activa
   resaltada. En pantallas pequeñas se pliega en un desplegable. */
.dagol-menu {
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.35);
}

.dagol-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 0;
    color: var(--text-color);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
}

.dagol-menu-list {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem 0.75rem;
}

.dagol-menu.is-open .dagol-menu-list {
    display: flex;
}

.dagol-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.6rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.dagol-menu-link:hover,
.dagol-menu-link:focus-visible {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.dagol-menu-link.is-active {
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.14);
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

.dagol-menu-link--role {
    display: none;
}

.dagol-menu-link--role.is-visible {
    display: inline-flex;
}

@media (min-width: 1024px) {
    .dagol-menu-toggle {
        display: none;
    }

    .dagol-menu-list {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.25rem 1.25rem 0.4rem;
    }
}

/* Identificación del usuario y del equipo / campeonato actuales en la cabecera. */
.dagol-context {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
    text-align: right;
    max-width: 14rem;
}

@media (min-width: 640px) {
    .dagol-context {
        display: flex;
    }
}

.dagol-context-user {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

.dagol-context-team {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

.dagol-context-team:empty {
    display: none;
}

/* ===== Pantalla de disputa de partido (DAGOL) ===== */
.match-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(22, 26, 29, 0.85), rgba(0, 0, 0, 0.5));
}

.match-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
    min-width: 0;
}

.match-side img {
    height: 3rem;
    width: auto;
    object-fit: contain;
}

.match-side-name {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #ffffff;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-side-stars {
    color: var(--accent-color);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.match-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.match-score {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
}

.match-weather {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.match-minute {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--accent-color);
}

.match-possession {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.match-possession--home {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(212, 175, 55, 0.12);
}

.match-possession--away {
    border-color: var(--primary-hover);
    color: var(--primary-hover);
    background: rgba(201, 59, 59, 0.14);
}

.match-rounds {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rounds-line {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.3rem;
}

.round-box {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.round-box:disabled {
    cursor: default;
    opacity: 0.9;
}

.round-box--current {
    border-color: var(--accent-color);
    box-shadow: inset 0 0 0 1px var(--accent-color);
    color: var(--accent-color);
}

.round-box--played {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-color);
}

.round-box--goal {
    background: rgba(34, 197, 94, 0.22);
    border-color: #22c55e;
    color: #86efac;
}

.round-box--empty {
    background: rgba(156, 163, 175, 0.16);
}

.round-box i {
    font-size: 0.58rem;
}

.match-tacticbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.match-tactic {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 0.7rem;
    background: rgba(0, 0, 0, 0.35);
    min-width: 0;
}

.match-tactic-title {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.match-tactic-line {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-color);
}

.match-tactic-ability {
    margin-top: 0.2rem;
    font-size: 0.65rem;
    color: var(--accent-color);
}

.match-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

.match-timer {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.match-timer--low {
    color: #ef4444;
}

/* Modal de fase y resumen */
.phase-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.85);
}

.phase-modal.is-open {
    display: flex;
}

.phase-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    max-width: 34rem;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(22, 26, 29, 0.96), rgba(0, 0, 0, 0.86));
}

.phase-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-color);
}

.phase-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color);
}

.phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: rgba(0, 0, 0, 0.35);
}

.phase-row span:first-child {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.phase-row span:last-child {
    font-weight: 700;
    text-align: right;
}

.phase-die {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 900;
}

.phase-note {
    margin: 0;
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-muted);
}

.phase-sub {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.2rem;
}

.phase-card-img {
    display: block;
    width: 100%;
    max-width: 14rem;
    margin: 0 auto;
    border: 1px solid var(--accent-color);
    border-radius: 0.6rem;
}

.phase-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Tarjetas de habilidad del entrenador (página Táctica del equipo de usuario). El estado
   seleccionado se controla con aria-pressed, sin utilidades con !important. */
.ability-option {
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.ability-option:hover,
.ability-option:focus-visible {
    border-color: var(--accent-color);
    outline: none;
}

.ability-option[aria-pressed="true"] {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.16);
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

/* Gestión durante el partido (DAGOL): cambios usados y aviso del último cambio táctico. */
.match-gestion-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.match-gestion-subs {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.match-gestion-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.match-gestion-status:empty {
    display: none;
}

/* Acceso a las sustituciones dentro del panel de gestión. */
.gestion-action {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.gestion-action:hover,
.gestion-action:focus-visible {
    border-color: var(--accent-color);
    background: rgba(212, 175, 55, 0.1);
    outline: none;
}

.gestion-action > i {
    margin-top: 0.15rem;
    color: var(--accent-color);
    font-size: 1.05rem;
}

.gestion-action span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.gestion-action strong {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.gestion-action em {
    font-size: 0.7rem;
    font-style: normal;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Bloque del cambio táctico. */
.gestion-tactic {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    background: rgba(0, 0, 0, 0.28);
}

.gestion-tactic-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-color);
}

.gestion-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gestion-field span {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.gestion-hint {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.gestion-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: var(--accent-color);
    color: #1a1614;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.gestion-apply:hover:not(:disabled),
.gestion-apply:focus-visible:not(:disabled) {
    background: #ffffff;
    outline: none;
}

.gestion-apply:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Ventana auxiliar con la plantilla del partido (sustituciones y alineación en vivo). */
.gestion-frame-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.88);
}

.gestion-frame-overlay.is-open {
    display: block;
}

.gestion-frame {
    width: 100%;
    height: 100%;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: var(--background-color);
}

.gestion-frame-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: var(--nav-bg);
    color: var(--accent-color);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.gestion-frame-close:hover,
.gestion-frame-close:focus-visible {
    background: var(--accent-color);
    color: #1a1614;
    outline: none;
}

