/* ============================================
   Blue Chip Analytics - Game Pages Styles
   Styles specific to individual game pages
   Tighter, utilitarian design - classic sports data feel
   ============================================ */

/* ===========================================
   DATA GRID LAYOUT FIX - Desktop
   General+Betting paired, Weather full, Travel full
   =========================================== */
@media (min-width: 769px) {
    .data-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Tighten the gap between the ticker and the game header (game pages only). */
.container {
    padding-top: 6px;
}

/* Game Header */
.game-header {
    background: white;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: -4px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.game-header .byline {
    margin-bottom: 0;
}

.team-name-link {
    display: inline-block;
    font-size: clamp(0.85rem, 3.8vw, 1.8em);
    font-weight: 700;
    color: var(--color-brand-dark);
    line-height: 1.1;
    margin-bottom: 2px;
    white-space: nowrap;
}

.team-name-link a {
    color: inherit;
    text-decoration: none;
}

.team-name-link a:hover {
    text-decoration: underline;
}

.game-info {
    font-size: 1em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

/* Game Preview Images */
.game-preview-image {
    text-align: center;
}

.game-preview-image img {
    max-width: 40%;
    height: auto;
    border-radius: 6px;
}

/* Team Info (Away vs Home) */
.team-info {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: baseline;
    margin-top: 6px;
}

.team {
    text-align: center;
    min-width: 0;
    white-space: nowrap;   /* keep each team's name + score on one line */
}

.team.away-team {
    text-align: right;
}

.team.home-team {
    text-align: left;
}

.team-details {
    color: var(--color-text-muted);
    font-size: 0.85em;
    line-height: 1.3;
}

.vs {
    font-size: 1.5em;
    font-weight: 300;
    color: #999;
}

/* Centre column: "@" connector, with final score beneath it on completed games */
.team-centre {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
}

.team-centre .final-label {
    font-size: 0.65em;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Final scores sit inline beside the team names, toward the centre @.
   The slot is reserved (min-width) even when empty (pre-game) so the team
   names and details stay put whether or not a score is present. */
.score.away-score,
.score.home-score {
    display: inline-block;
    min-width: 1.8rem;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--color-brand-dark);
    vertical-align: baseline;
}

/* Score sits toward the centre @ within its reserved slot. */
.score.away-score { text-align: right; }
.score.home-score { text-align: left; }

/* Details align under the team name's inner edge, not under the score slot
   (offset = the reserved score-slot width). */
.team.away-team .team-details { margin-right: 1.8rem; }
.team.home-team .team-details { margin-left: 1.8rem; }

/* Narrative Section — .narrative-team/-item/-title/-description live in base.css */
.narrative-section {
    margin-top: 12px;
}

/* Game-only: per-team sub-heading (team pages show a single team, no heading) */
.narrative-team-name {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--color-brand-dark);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--color-border-mid);
    padding-bottom: 4px;
}

/* Weather Components */
.weather-grid {
    display: grid;
    gap: 10px;
}

.weather-main {
    text-align: center;
    padding: 10px;
    background: var(--color-bg-tint);
    border-radius: 6px;
}

.weather-condition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.weather-icon {
    width: 48px;
    height: 48px;
}

.temp-main {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--color-brand-dark);
    margin: 0;
}

.weather-forecast-date {
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.weather-details {
    display: grid;
    gap: 0;
}

.weather-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid var(--color-border-mid);
    font-size: 0.9em;
}

.weather-row:last-child {
    border-bottom: none;
}

/* Betting Information */
.betting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.betting-item {
    text-align: center;
    padding: 10px;
    background: var(--color-bg-tint);
    border-radius: 6px;
}

.betting-label {
    display: block;
    font-size: 0.8em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.betting-value {
    display: block;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--color-brand-dark);
}

/* Travel Information */
.travel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 769px) {
    .travel-grid {
        grid-template-columns: 1fr;
    }
}

.travel-team {
    background: var(--color-bg-tint);
    border-radius: 6px;
    padding: 10px;
}

.travel-team h4 {
    color: var(--color-brand-dark);
    margin-bottom: 6px;
    font-size: 0.9em;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-border-mid);
}

.travel-stats {
    display: grid;
    gap: 0;
}

.travel-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.85em;
}

/* ==========================================
   LINE VALUE CALCULATOR
   ========================================== */
.calculator-container {
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.calculator-header {
    background: var(--color-brand-dark);
    padding: 12px 16px;
    color: white;
    text-align: center;
}

.calculator-header .section-title {
    font-size: 1.05em;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
    border-bottom: none;
    padding-bottom: 0;
}

.calculator-subtitle {
    font-size: 0.78em;
    color: rgba(255,255,255,0.75);
    margin: 0;
}

/* Result bar — always visible directly under header */
.calc-result-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--color-border-mid);
}

.calc-result-cell {
    padding: 10px 16px;
    background: white;
}

.calc-result-cell:first-child {
    border-right: 1px solid var(--color-border-mid);
}

.calc-result-label {
    display: block;
    font-size: 0.72em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.calc-result-value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--color-brand-dark);
    white-space: nowrap;
}

.calc-result-value--implied {
    color: #276749;
}

/* Two-column body */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.calculator-left,
.calculator-right {
    padding: 14px 16px;
}

.calculator-left {
    border-bottom: 1px solid var(--color-border-mid);
}

/* Group label (replaces old box section titles) */
.calc-group-label {
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.calc-group-label-note {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-muted);
}

/* Horizontal divider between groups */
.calc-divider {
    height: 1px;
    background: var(--color-border-mid);
    margin: 10px 0;
}

/* Data rows — two-column: label left, value right */
.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.85em;
    gap: 8px;
}

.calc-row:last-of-type,
.calc-row.calc-row--last {
    border-bottom: none;
}

/* Power rating rows use the standard calc-row — label left, input right */

.calc-label {
    color: var(--color-text-secondary);
    flex: 1;
}

.calc-value {
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: right;
    white-space: nowrap;
}

/* Section title row with inline input (Travel, HFA, Weather) */
.calc-section-title-with-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-border-mid);
}

.calc-section-title-with-input span {
    flex: 1;
}

.calc-section-title-with-input .calc-input {
    margin-left: 10px;
    width: 64px;
    flex-shrink: 0;
}

/* Inputs */
.calc-input {
    padding: 4px 8px;
    font-size: 0.85em;
    border: 1px solid var(--color-border-strong);
    border-radius: 4px;
    text-align: center;
    width: 64px;
}

.calc-input:focus {
    outline: none;
    border-color: var(--color-brand-dark);
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.15);
}

.calc-input-highlight {
    border: 2px solid var(--color-brand-light);
    background: #ebf8ff;
}

.calc-input-highlight:focus {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.25);
}

/* Small hint text at bottom of right column */
.calc-hint {
    font-size: 0.75em;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 4px;
}


/* Time Display Elements */
#header-time,
#general-info-time {
    cursor: help;
}

/* ==========================================
   RESPONSIVE - Mobile First
   ========================================== */
@media (max-width: 768px) {
    .game-preview-image img {
        max-width: 100%;
    }

    .game-header {
        padding: 8px 8px;
        margin-top: -2px;
        margin-bottom: 10px;
    }

    .team-name-link {
        margin-bottom: 4px;
    }

    .game-info {
        font-size: 0.8em;
        margin-bottom: 2px;
    }

    .team-info {
        grid-template-columns: 1fr auto 1fr;
        gap: 5px;
        align-items: baseline;
        margin-top: 4px;
    }

    .team {
        padding: 2px 0;
    }

    .team-details {
        font-size: 0.65em;
        line-height: 1.2;
    }

    .vs {
        font-size: 0.85em;
        opacity: 0.6;
    }

    .final-score {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px;
    }

    .final-score .score {
        font-size: 1.4em;
        font-weight: 700;
        color: var(--color-brand-dark);
    }

    .final-score .final-label {
        font-size: 0.7em;
        font-weight: 600;
        color: var(--color-text-muted);
        letter-spacing: 0.5px;
    }

    .narrative-team-name {
        font-size: 1.1em;
    }

    /* MOBILE BETTING - Compact layout */
    .betting-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-bottom: 6px;
    }

    .betting-item {
        padding: 6px;
    }

    .betting-label {
        font-size: 0.75em;
        margin-bottom: 1px;
    }

    .betting-value {
        font-size: 1em;
    }

    /* Power Rank Implied Line compact */
    .betting-section .data-row {
        padding: 4px 0;
        font-size: 0.8em;
    }

    .travel-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .travel-team {
        padding: 8px;
    }

    .travel-team h4 {
        font-size: 0.75em;
        margin-bottom: 4px;
    }

    .travel-row {
        font-size: 0.85em;
        padding: 1px 0;
    }

    /* MOBILE CALCULATOR */
    .calculator-header {
        padding: 8px 12px;
    }

    .calculator-header .section-title {
        font-size: 1.05em;
    }

    .calculator-subtitle {
        font-size: 0.75em;
    }

    /* Result bar stays side-by-side on mobile */
    .calc-result-cell {
        padding: 8px 12px;
    }

    .calc-result-value {
        font-size: 1.05em;
    }

    /* Single column: left then right stack vertically */
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .calculator-left {
        border-bottom: 1px solid var(--color-border-mid);
        border-right: none;
        padding: 12px 12px;
    }

    .calculator-right {
        padding: 12px 12px;
    }

    .calc-row {
        font-size: 0.85em;
    }

    .calc-section-title-with-input {
        font-size: 0.75em;
    }

    .calc-section-title-with-input .calc-input {
        width: 54px;
        padding: 2px 4px;
        font-size: 0.85em;
    }

    .calc-input {
        width: 54px;
        padding: 2px 4px;
        font-size: 0.8em;
    }

    .weather-icon {
        width: 40px;
        height: 40px;
    }

    .temp-main {
        font-size: 1.1em;
    }

    .weather-row {
        font-size: 0.85em;
        padding: 3px 0;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 8px 6px;
        margin-bottom: 8px;
    }

    .team-info {
        gap: 3px;
    }

    .team {
        padding: 2px 0;
    }

    .team-details {
        font-size: 0.6em;
    }

    .final-score {
        gap: 6px;
        padding: 6px;
    }

    .final-score .score {
        font-size: 1.2em;
    }

    .final-score .final-label {
        font-size: 0.65em;
    }

    .narrative-team-name {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .weather-condition {
        flex-direction: column;
        gap: 6px;
    }

    .weather-icon {
        width: 36px;
        height: 36px;
    }

    .temp-main {
        font-size: 1.05em;
    }

    .weather-row {
        font-size: 0.8em;
    }

    /* Extra tight betting on small screens */
    .betting-grid {
        gap: 4px;
    }

    .betting-item {
        padding: 4px;
    }

    .betting-label {
        font-size: 0.72em;
    }

    .betting-value {
        font-size: 1em;
    }

    .travel-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .travel-team {
        padding: 6px;
    }

    .travel-team h4 {
        font-size: 0.72em;
    }

    .travel-row {
        font-size: 0.8em;
    }

    /* Calculator extra small */
    .calculator-header {
        padding: 6px 10px;
    }

    .calculator-header .section-title {
        font-size: 1em;
    }

    .calculator-subtitle {
        font-size: 0.7em;
    }

    .calculator-left,
    .calculator-right {
        padding: 10px 10px;
    }

    .calc-result-cell {
        padding: 7px 10px;
    }

    .calc-result-value {
        font-size: 1em;
    }

    .calc-row {
        font-size: 0.8em;
    }

    .calc-section-title-with-input {
        font-size: 0.72em;
    }

    .calc-section-title-with-input .calc-input {
        width: 54px;
        padding: 2px 3px;
        font-size: 0.8em;
    }

    .calc-input {
        width: 54px;
        padding: 2px 3px;
        font-size: 0.75em;
    }
}

/* ==========================================
   RESPONSIVE - Tablet and Desktop
   ========================================== */
@media (min-width: 769px) {
    /* Two-column side-by-side */
    .calculator-grid {
        grid-template-columns: 1fr 1fr;
    }

    .calculator-left {
        border-right: 1px solid var(--color-border-mid);
        border-bottom: none;
    }

    .calculator-right {
        border-bottom: none;
    }
}

@media (min-width: 900px) {
    .game-header {
        padding: 14px 18px;
    }

    .team-name-link {
        font-size: 2em;
    }

    .team-details {
        font-size: 0.9em;
    }

    .calculator-left,
    .calculator-right {
        padding: 16px 18px;
    }
}

