/*
 * Pickleball CLI Web App Stylesheet
 * Faithfully mirrors iOS SwiftUI AppTheme & Layout
 */

:root {
    --bg-page: #f6f9fc;
    --bg-card: #ffffff;
    --primary: #0e634d;
    --primary-light: rgba(14, 99, 77, 0.08);
    --primary-gradient: linear-gradient(135deg, #125294 0%, #0e634d 100%);
    --secondary: #125294;
    --secondary-soft: rgba(18, 82, 148, 0.08);
    --accent: #f57d2e;
    --accent-soft: rgba(245, 125, 46, 0.10);
    --text-primary: #1c1c1e;
    --text-secondary: #6c7278;
    --text-muted: #8e8e93;
    --divider: rgba(0, 0, 0, 0.07);
    --border-card: rgba(0, 0, 0, 0.06);
    --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.04);
    --shadow-elevated: 0 10px 25px rgba(14, 99, 77, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 9999px;
    --team-a: #f25970;
    --team-b: #3394e6;
    --team-c: #63b05c;
    --team-d: #f5943d;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(180deg, #f6f9fc 0%, #ffffff 50%, rgba(14, 99, 77, 0.04) 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
}

/* App container */
.app-container {
    width: 100%;
    max-width: 1140px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(246, 249, 252, 0.92);
    border-bottom: 1px solid var(--divider);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.header-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(14, 99, 77, 0.25);
}

.header-logo svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.header-text h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-text .header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.09);
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Main Content Area */
.app-content {
    flex: 1;
    padding: 14px 16px calc(80px + var(--safe-bottom));
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Banner */
.hero-card {
    background: var(--primary-gradient);
    border-radius: 22px;
    padding: 20px;
    color: #ffffff;
    box-shadow: var(--shadow-elevated);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.hero-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.hero-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-badge-icon svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

.hero-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 6px;
    font-weight: 500;
}

.hero-tagline {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Team Legend */
.team-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border-card);
}

.team-badge-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legend-info {
    min-width: 0;
    flex: 1;
}

.legend-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.legend-players {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 12px;
}

.section-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Rest break card */
.rest-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 15px;
    background: var(--accent-soft);
    color: var(--accent);
    margin: 14px 0;
    border: 1px dashed rgba(245, 125, 46, 0.3);
}

.rest-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.rest-text {
    flex: 1;
}

.rest-title {
    font-size: 13px;
    font-weight: 700;
}

.rest-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Match Card */
.match-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 14px;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.match-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.match-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.badge-complete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #28a745;
    background: rgba(40, 167, 69, 0.12);
    padding: 4px 9px;
    border-radius: var(--radius-pill);
}

.badge-complete svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.match-vs {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.card-divider {
    height: 1px;
    background: var(--divider);
    margin: 12px 0 14px;
}

/* Set Score Rows */
.sets-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.set-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
    transition: opacity 0.2s ease;
}

.set-row.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.set-label {
    width: 54px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.set-inputs-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.score-input {
    width: 58px;
    height: 44px;
    border-radius: 11px;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    background: #ffffff;
    font-size: 18px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Mono", monospace;
    text-align: center;
    color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -moz-appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.set-separator {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Nút lưu từng hiệp / từng trận */
.btn-save-set {
    flex-shrink: 0;
    height: 44px;
    padding: 0 14px;
    border: none;
    border-radius: 11px;
    background: var(--primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

.btn-save-set:disabled {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-muted);
    cursor: default;
}

.btn-save-set:not(:disabled):active,
.btn-save-match:not(:disabled):active {
    transform: scale(0.97);
}

.set-row.dirty .score-input {
    background: #fffbea;
}

.btn-save-match {
    width: 100%;
    margin-top: 12px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-save-match:not(:disabled):hover {
    background: #0a4f3d;
}

.btn-save-match:disabled {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    cursor: default;
}

.match-winner-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-top: 12px;
    padding-top: 6px;
}

.match-winner-banner svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Standings Tab */
.rules-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px;
    border: 1px solid var(--border-card);
    margin-bottom: 16px;
}

.rules-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 6px;
}

.rules-header svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.rules-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.rules-note {
    font-size: 11px;
    color: var(--text-muted);
}

.alert-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 149, 0, 0.10);
    color: #c45d00;
    font-size: 12px;
    font-weight: 600;
    margin-top: 14px;
    border: 1px solid rgba(255, 149, 0, 0.25);
}

.alert-card svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Compact Standings Cards (Mobile) */
.standings-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.standing-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 15px;
    border: 1px solid var(--border-card);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.035);
}

.standing-card.top-rank {
    border-color: rgba(14, 99, 77, 0.25);
}

.standing-top {
    display: flex;
    align-items: center;
    gap: 11px;
}

.rank-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.standing-team-info {
    flex: 1;
    min-width: 0;
}

.standing-team-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.standing-team-players {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.standing-points-badge {
    text-align: right;
}

.points-num {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", monospace;
}

.points-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.metrics-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.metric-box {
    background: var(--bg-page);
    border-radius: 11px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-title {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.metric-val {
    font-size: 14px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", monospace;
    color: var(--text-primary);
}

/* Standings Table (Desktop / Large View) */
.standings-table-wrap {
    display: none;
    overflow-x: auto;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-card);
    padding: 8px;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.standings-table th {
    background: var(--secondary-soft);
    color: var(--secondary);
    font-weight: 700;
    padding: 10px 8px;
    border-radius: 8px;
}

.standings-table td {
    padding: 10px 8px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", monospace;
    border-bottom: 1px solid var(--divider);
}

.standings-table tr:last-child td {
    border-bottom: none;
}

.standings-table .col-team {
    text-align: left;
    font-family: inherit;
    font-weight: 700;
}

@media (min-width: 600px) {
    .standings-cards {
        display: none;
    }
    .standings-table-wrap {
        display: block;
    }
}

/* Finals Tab */
.waiting-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 20px;
    text-align: center;
    border: 1px solid var(--border-card);
    margin-bottom: 16px;
}

.waiting-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--secondary-soft);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.waiting-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.waiting-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.waiting-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Qualification Summary */
.summary-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    border: 1px solid var(--border-card);
    margin-bottom: 16px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.summary-header svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Podium Card */
.podium-card {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.16) 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 18px;
    border: 1px solid rgba(255, 204, 0, 0.4);
    box-shadow: 0 8px 24px rgba(255, 193, 7, 0.15);
    margin-bottom: 20px;
}

.podium-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    text-align: center;
    margin-bottom: 14px;
}

.podium-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.podium-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.88);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.podium-item.champion {
    background: #ffffff;
    border-color: rgba(255, 193, 7, 0.6);
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.15);
}

.podium-medal {
    font-size: 26px;
    line-height: 1;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.podium-info {
    flex: 1;
    min-width: 0;
}

.podium-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.podium-team-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.podium-item.champion .podium-team-name {
    font-size: 16px;
    font-weight: 800;
    color: #b86a00;
}

/* Bottom Tab Bar (iOS style) */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1140px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 12px calc(6px + var(--safe-bottom));
    z-index: 50;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: transform 0.15s ease;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active svg {
    transform: scale(1.08);
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 22px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    transform: scale(0.92);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 20px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.modal-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border-radius: 11px;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    background: #ffffff;
    font-size: 15px;
    color: var(--text-primary);
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.modal-error {
    min-height: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ff3b30;
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-danger {
    background: #ff3b30;
    color: #ffffff;
}

.btn-danger:hover {
    background: #e02d23;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.10);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #0a4f3d;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(28, 28, 30, 0.94);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 120;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Utilities Menu dropdown */
.menu-dropdown {
    position: absolute;
    top: 54px;
    right: 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
    border: 1px solid var(--border-card);
    width: 220px;
    padding: 6px;
    display: none;
    flex-direction: column;
    z-index: 60;
}

.menu-dropdown.active {
    display: flex;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.menu-item:hover {
    background: var(--bg-page);
}

.menu-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    color: var(--primary);
}

/* Print styles */
@media print {
    body {
        background: #ffffff !important;
    }
    .app-header, .tab-bar, .modal-overlay, .toast, .menu-dropdown, .icon-btn {
        display: none !important;
    }
    .app-content {
        padding: 0 !important;
    }
    .tab-content {
        display: block !important;
        page-break-after: always;
    }
    .score-input {
        border: 1px solid #000 !important;
    }
}

/* Desktop & Tablet Layout Enhancements */
@media (min-width: 768px) {
    .team-legend {
        grid-template-columns: repeat(4, 1fr);
    }
    .matches-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .match-card {
        margin-bottom: 0; /* Let grid gap handle spacing */
    }
    .rest-card {
        grid-column: 1 / -1;
        margin: 0;
    }
    .podium-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .matches-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

