.porra-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.porra-container-wide {
    max-width: 1100px;
}

.porra-header h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.porra-match {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.porra-matchday {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.porra-upcoming-match {
    color: #fff;
    background: #1a73e8;
    border-radius: 999px;
    display: inline-block;
    font-size: 0.82em;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    padding: 6px 16px;
    text-transform: uppercase;
}

.porra-upcoming-match-live {
    background: #218838;
    font-size: 0.98em;
    letter-spacing: 0.06em;
    padding: 8px 20px;
}

.porra-competition {
    color: #34495e;
    font-size: 0.95em;
    font-weight: 700;
    margin: 0 0 8px;
}

.porra-teams {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.porra-team {
    font-weight: bold;
    font-size: 1.2em;
}

.porra-vs {
    color: #999;
    font-size: 1em;
}

.porra-match-info {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.porra-result {
    font-size: 1.5em;
    color: #1a73e8;
    margin: 10px 0;
}

.porra-betting-open,
.porra-betting-closed {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: bold;
}

.porra-betting-open {
    background: #d4edda;
    color: #155724;
}

.porra-betting-closed {
    background: #f8d7da;
    color: #721c24;
}

.porra-betting-opening-info {
    border-bottom: 2px solid #1a73e8;
    color: #1a4f8a;
    display: inline-block;
    font-size: 0.9em;
    font-weight: 600;
    margin: 18px 0 15px;
    padding-bottom: 4px;
}

.porra-result-pending {
    background: #f8d7da;
    border: 1px solid #e4a8af;
    border-radius: 4px;
    color: #721c24;
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 15px;
    padding: 12px;
    text-align: center;
}

.porra-login-msg {
    background: #fff3cd;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.porra-form {
    margin-top: 15px;
}

.porra-form-wrapper {
    display: table;
    margin: 0 auto;
    width: auto;
}

.porra-scores {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.porra-score-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.porra-score-label span {
    font-size: 0.85em;
    color: #666;
}

.porra-input-score {
    width: 60px;
    height: 50px;
    font-size: 1.5em;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 5px;
}

.porra-separator {
    font-size: 1.5em;
    font-weight: bold;
    color: #999;
}

.porra-scorer {
    margin-bottom: 20px;
    text-align: left;
}

.porra-scorer label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.porra-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.porra-view-predictions-link {
    display: block;
    margin: 2px 0 30px;
    text-align: center;
    font-size: 1.15em;
    font-weight: 600;
}

.porra-button {
    width: 100%;
    padding: 15px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.porra-button:hover {
    background: #1557b0;
}

.porra-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.porra-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
}

.porra-message.success {
    background: #d4edda;
    color: #155724;
}

.porra-message.error {
    background: #f8d7da;
    color: #721c24;
}

.porra-user-prediction {
    background: #e8f4f8;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.porra-points {
    margin-top: 10px;
    font-size: 1.2em;
}

.porra-point-detail {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}

.porra-mini-ranking {
    margin-top: 30px;
}

.porra-mini-ranking h3 {
    text-align: center;
    margin-bottom: 15px;
}

.porra-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.porra-table th,
.porra-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.porra-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.porra-prediction-hit {
    color: #16803c;
    font-size: 1.15em;
    font-weight: 700;
}

.porra-email-alerts-option {
    margin: 18px 0;
}

.porra-email-alerts-option label {
    display: block;
}

.porra-ranking-table td:nth-child(1),
.porra-ranking-table td:nth-child(3),
.porra-ranking-table td:nth-child(4),
.porra-ranking-table td:nth-child(5),
.porra-ranking-table td:nth-child(6) {
    text-align: center;
}

.porra-profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.porra-stat {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.porra-stat-label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
}

.porra-stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #1a73e8;
}

.porra-alert {
    background: #fff3cd;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    margin: 15px 0;
}

.porra-individual-pool {
    --individual-ink: #1c355e;
    --individual-accent: #167457;
    --individual-wash: #f3f7f5;
}

.porra-individual-pool .porra-header h2 {
    color: var(--individual-ink);
    font-size: clamp(1.45rem, 4vw, 2rem);
    letter-spacing: .06em;
}

.porra-individual-match {
    background: linear-gradient(135deg, #f3f7f5, #fffaf1);
    border: 1px solid #d6e0df;
}

.porra-individual-prize {
    color: var(--individual-ink);
    font-size: 1.08em;
    margin: 1rem 0 .4rem;
}

.porra-individual-description {
    margin: .75rem auto;
    max-width: 650px;
}

.porra-individual-image {
    border-radius: 8px;
    display: block;
    margin: 1.25rem auto;
    max-height: 360px;
    max-width: 100%;
    object-fit: cover;
}

.porra-individual-predictions {
    margin-top: 2rem;
}

.porra-individual-predictions h3,
.porra-individual-winners h3 {
    color: var(--individual-ink);
    margin-bottom: .75rem;
}

.porra-individual-winners {
    background: var(--individual-wash);
    border-left: 4px solid var(--individual-accent);
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    text-align: left;
}

.porra-individual-winners ul {
    margin: .5rem 0 0 1.25rem;
}

.porra-manual {
    max-width: 1180px;
}

.porra-manual > h1 {
    color: #1c355e;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 1.5rem 0;
}

.porra-manual-layout {
    display: grid;
    grid-template-columns: minmax(210px, 270px) minmax(0, 760px);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
}

.porra-manual-toc {
    background: #f3f7f5;
    border-left: 4px solid #167457;
    padding: 1rem 1.25rem;
    position: sticky;
    top: 1rem;
}

.porra-manual-toc h2 {
    color: #1c355e;
    font-size: 1rem;
    margin: 0 0 .75rem;
}

.porra-manual-toc ol {
    margin: 0;
    padding-left: 1.1rem;
}

.porra-manual-toc li {
    line-height: 1.35;
    margin: .4rem 0;
}

.porra-manual-toc .porra-manual-toc-level-3 {
    margin-left: .7rem;
    font-size: .9em;
}

.porra-manual-toc a {
    color: #17584a;
    text-decoration: none;
}

.porra-manual-toc a:hover,
.porra-manual-toc a:focus {
    color: #0d3d91;
    text-decoration: underline;
}

.porra-manual-content {
    color: #27333e;
    line-height: 1.7;
    min-width: 0;
}

.porra-manual-content h1,
.porra-manual-content h2,
.porra-manual-content h3 {
    color: #1c355e;
    line-height: 1.2;
    margin: 2.2rem 0 .8rem;
    scroll-margin-top: 1.5rem;
}

.porra-manual-content h1 { font-size: 2rem; margin-top: 0; }
.porra-manual-content h2 { font-size: 1.45rem; }
.porra-manual-content h3 { font-size: 1.15rem; }
.porra-manual-content p { margin: 0 0 1rem; }
.porra-manual-content ul,
.porra-manual-content ol { margin: 0 0 1rem 1.25rem; }
.porra-manual-content li { margin: .35rem 0; }
.porra-manual-content code { background: #edf1f4; border-radius: 3px; color: #5b2732; font-size: .9em; padding: .12em .3em; }

.porra-manual-table-wrap {
    margin: 1.25rem 0;
    overflow-x: auto;
}

.porra-manual-content table {
    border-collapse: collapse;
    min-width: 520px;
    width: 100%;
}

.porra-manual-content th,
.porra-manual-content td {
    border: 1px solid #d6e0df;
    padding: .65rem .8rem;
    text-align: left;
    vertical-align: top;
}

.porra-manual-content th { background: #e7f0ed; color: #193f37; }

@media (max-width: 768px) {
    .porra-manual-layout { display: block; }
    .porra-manual-toc { margin-bottom: 1.5rem; position: static; }
    .porra-container {
        padding: 10px;
    }

    .porra-nav {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px;
    }

    .porra-nav-link {
        flex: 1 1 45%;
        padding: 12px 8px;
        font-size: 0.85em;
        letter-spacing: 0;
    }

    .porra-nav-link.porra-nav-logout {
        flex: 1 1 100%;
        order: 5;
    }

    .porra-profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .porra-history-table {
        min-width: 700px;
    }

    .porra-form-wrapper {
        width: 100%;
        padding: 0 10px;
    }

    .porra-scores {
        gap: 10px;
    }

    .porra-input-score {
        width: 70px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .porra-container {
        padding: 5px;
    }

    .porra-nav-link {
        flex: 1 1 100%;
        padding: 10px 8px;
        font-size: 0.8em;
    }

    .porra-profile-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .porra-stat {
        padding: 10px;
    }

    .porra-stat-value {
        font-size: 1.3em;
    }

    .porra-history-table {
        min-width: 600px;
        font-size: 0.85em;
    }

    .porra-history-table th,
    .porra-history-table td {
        padding: 8px 6px;
    }

    .porra-input-score {
        width: 55px;
        height: 42px;
        font-size: 1.2em;
    }

    .porra-separator {
        font-size: 1.2em;
    }

    .porra-scorer label {
        font-size: 0.9em;
    }

    .porra-select {
        font-size: 0.95em;
        padding: 8px;
    }

    .porra-button {
        padding: 12px;
        font-size: 1em;
    }

    .porra-login-required {
        padding: 40px 15px;
    }

    .porra-login-required h3 {
        font-size: 1.4em;
    }

    .porra-login-button {
        padding: 12px 30px;
        font-size: 1em;
    }
}

/* Profile wide layout */
.porra-container-wide {
    max-width: 1100px;
}

.porra-history-wrapper {
    margin-bottom: 15px;
}

.porra-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
}

.porra-table-wrapper:focus {
    outline: 2px solid #1a73e8;
    outline-offset: 3px;
}

.porra-results-table {
    min-width: 720px;
}

.porra-ranking-table {
    min-width: 620px;
}

.porra-history-table {
    min-width: 800px;
    font-size: 0.95em;
}

.porra-history-table th,
.porra-history-table td {
    padding: 12px 10px;
    white-space: nowrap;
}

.porra-hit {
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

/* Profile stats - ensure 5 items fit */
.porra-profile-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .porra-table-wrapper {
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }

    .porra-results-table {
        min-width: 680px;
    }

    .porra-ranking-table {
        min-width: 580px;
    }

    .porra-profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .porra-history-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .porra-results-table {
        min-width: 650px;
    }

    .porra-ranking-table {
        min-width: 550px;
    }

    .porra-profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Navigation Bar */
.porra-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: #ffffff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
}

.porra-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    text-align: center;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    font-size: 1.1em;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.porra-nav-link:hover {
    background: #f5f5f5;
    color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.porra-nav-link.porra-nav-active {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.porra-nav-link.porra-nav-active:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    color: white;
    transform: translateY(-2px);
}

/* Logout Button */
.porra-nav-link.porra-nav-logout {
    background: #f8f9fa;
    color: #dc3545;
    border: 2px solid #dc3545;
}

.porra-nav-link.porra-nav-logout:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}
.porra-nav-link.porra-nav-help {
    align-items: center;
    border: 2px solid #1d65c1;
    border-radius: 50%;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 30px;
    font-size: 1rem;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    min-height: 30px;
    min-width: 30px;
    padding: 0;
    width: 30px;
}

/* Compact, scrollable navigation */
.porra-nav {
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 6px;
}

.porra-nav-link {
    min-height: 38px;
    padding: 9px 13px;
    font-size: 0.86em;
    letter-spacing: 0.2px;
}

.porra-nav-link.porra-nav-logout {
    flex: 0 0 auto;
    border-width: 1px;
}

@media (max-width: 768px) {
    .porra-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .porra-nav::-webkit-scrollbar {
        display: none;
    }

    .porra-nav-link,
    .porra-nav-link.porra-nav-logout {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 8px 11px;
        font-size: 0.8em;
        white-space: nowrap;
    }
}

/* Login Required Screen */
.porra-login-required {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    margin-top: 20px;
}

.porra-login-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
}

.porra-login-required h3 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.porra-login-required p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.porra-login-button {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.porra-login-button:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
    color: white;
}

/* Login Form */
.porra-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.porra-login-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.porra-login-box .porra-login-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.porra-login-box h2 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.8em;
}

.porra-login-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.porra-login-form {
    text-align: left;
}

.porra-form-group {
    margin-bottom: 20px;
}

.porra-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.porra-form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #fafafa;
}

.porra-form-control:focus {
    outline: none;
    border-color: #1a73e8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.porra-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.85em;
    flex-wrap: wrap;
    gap: 10px;
}

.porra-remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #666;
}

.porra-remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
}

.porra-forgot-password {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s;
}

.porra-forgot-password:hover {
    color: #1557b0;
    text-decoration: underline;
}

.porra-login-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
    font-size: 1.1em;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.porra-login-submit:hover {
    background: linear-gradient(135deg, #1557b0 0%, #0d47a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.4);
}

.porra-login-footer {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.porra-login-footer a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 600;
}

.porra-login-footer a:hover {
    text-decoration: underline;
}

/* Confirmation Box */
.porra-confirmation-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 30px 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}

.porra-confirmation-header {
    margin-bottom: 20px;
}

.porra-confirmation-icon {
    display: inline-block;
    width: 50px;
    height: 50px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 28px;
    line-height: 50px;
    margin-bottom: 10px;
}

.porra-confirmation-header h3 {
    color: #155724;
    margin: 0;
    font-size: 1.3em;
}

.porra-confirmation-match {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.porra-confirmation-match .porra-team-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.porra-confirmation-match .porra-score {
    font-size: 2em;
    font-weight: bold;
    color: #1a73e8;
}

.porra-confirmation-match .porra-separator {
    font-size: 1.5em;
    color: #666;
}

.porra-confirmation-scorer {
    color: #155724;
    font-size: 1em;
    margin: 15px 0 10px;
}

.porra-confirmation-info {
    color: #155724;
    font-size: 0.9em;
    margin: 10px 0 20px;
    font-style: italic;
    opacity: 0.9;
}

.porra-button-outline {
    background: transparent !important;
    color: #28a745 !important;
    border: 2px solid #28a745 !important;
    margin-top: 10px;
}

.porra-button-outline:hover {
    background: #28a745 !important;
    color: white !important;
}

@media (max-width: 480px) {
    .porra-login-box {
        padding: 25px 20px;
    }

    .porra-login-box h2 {
        font-size: 1.5em;
    }

    .porra-form-control {
        padding: 12px 14px;
    }

    .porra-login-submit {
        padding: 14px;
    }
}
