/* Game-specific styles layered on top of the shared DITIS stylesheet */

:root {
    --suit-s-bg: #e53935;
    --suit-s-text: #fff;
    --suit-t-bg: #fa8a00;
    --suit-t-text: #fff;
    --suit-r-bg: #fed500;
    --suit-r-text: #333;
    --suit-i-bg: #429f46;
    --suit-i-text: #333;
    --suit-d-bg: #1e87e3;
    --suit-d-text: #fff;
    --suit-e-bg: #5d35b0;
    --suit-e-text: #fff;
    --suit-p-bg: #3c2722;
    --suit-p-text: #fff;
}

body {
    overflow-y: scroll;
}

body.eop-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.eop-page-main {
    flex: 1;
    display: block;
}

.eop-page-footer {
    margin-top: auto;
}

.eop-topbar {
    min-height: 6.25rem;
    gap: 1rem;
}

.eop-topbar-meta,
.size-controls,
.eop-chip-row {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.eop-topbar-separator {
    width: 1px;
    height: 1.5rem;
    background-color: var(--primary--200);
    margin: 0 0.25rem;
}

.eop-brand svg {
    width: 5.25rem;
    display: block;
}

.eop-hero-row {
    align-items: stretch;
}

.eop-hero-copy {
    display: flex;
    flex-direction: column;
}

.eop-surface {
    padding: 2rem;
}

.eop-form-stack {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.resume-toggle-card {
    margin-top: 0.25rem;
    border: 1px solid var(--primary--200);
    background: var(--primary--100);
    padding: 0.75rem 0.9rem;
}

.resume-toggle-label {
    margin-bottom: 0;
    align-items: center;
    gap: 0.6rem;
    padding-left: 0;
    display: flex;
}

.resume-toggle-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--primary--900);
    border-radius: 0;
    background: var(--base--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.resume-toggle-checkbox:hover {
    border-color: var(--base--action);
}
.resume-toggle-checkbox:checked {
    background: var(--base--action);
    border-color: var(--base--action);
}

.resume-toggle-checkbox:checked::after {
    content: '';
    width: 0.22rem;
    height: 0.46rem;
    border: solid var(--base--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -0.04rem;
}

.resume-toggle-checkbox:focus-visible {
    outline: 2px solid var(--primary--500);
    outline-offset: 2px;
}

.resume-toggle-title {
    margin: 0;
    line-height: 1.2;
}

.resume-toggle-hint {
    margin: 0.3rem 0 0 1.9rem;
    line-height: 1.35;
}

.eop-chip {
    border: 1px solid var(--primary--200);
    background: var(--base--white);
    padding: 0.35rem 0.75rem;
}

.eop-chip-row-hero {
    margin-top: auto;
}

.eop-panel-header,
.eop-footer-bar {
    gap: 1rem;
}

.eop-license-link {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.22rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.eop-license-link:hover,
.eop-license-link:focus-visible {
    color: var(--primary--200);
}

.eop-license-link:focus-visible {
    outline: 2px solid var(--primary--200);
    outline-offset: 2px;
}

.eop-section-block + .eop-section-block {
    margin-top: 1rem;
}

.link-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: var(--primary--100);
    border: 1px solid var(--primary--200);
    margin-bottom: 0.75rem;
}

.link-box a {
    flex: 1;
    word-break: break-all;
    color: var(--secondary--800);
    text-decoration: none;
}

.link-box a:hover {
    color: var(--base--action);
    text-decoration: underline;
}

.size-btn.active {
    background-color: var(--base--action) !important;
    border-color: var(--base--action) !important;
    color: var(--base--white) !important;
}

.button-secondary.copied {
    background-color: var(--primary--900) !important;
    border-color: var(--primary--500) !important;
    color: var(--base--white) !important;
}

.eop-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 8rem;
    flex: 0 0 auto;
}

.eop-copy-button:hover {
    background-color: var(--primary--500);
    border-color: var(--primary--500);
    color: var(--base--white);
}

.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.card {
    width: 320px;
    border: 1px solid var(--primary--200);
    background: var(--base--white);
    cursor: pointer;
    transition: transform 0.2s, opacity 0.3s, filter 0.3s, box-shadow 0.2s;
    box-shadow: 0 0 10px -4px #00000026, 0 5px 5px -7.5px #0003;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 10px -4px #00000026, 0 12px 15px -12.5px #0003, 0 25px 30px -25px #0000004d;
}

.card img {
    width: 320px;
    object-fit: contain;
    display: block;
}

.card.size-small {
    width: 240px;
}

.card.size-small img {
    width: 240px;
}

.card.size-medium {
    width: 320px;
}

.card.size-medium img {
    width: 320px;
}

.card.size-large {
    width: 400px;
}

.card.size-large img {
    width: 400px;
}

.card.size-xlarge {
    width: 500px;
}

.card.size-xlarge img {
    width: 500px;
}

.played {
    opacity: 0.3;
    filter: grayscale(100%);
    transform: scale(0.95);
}

.card-list-compact {
    max-width: 100%;
}

.eop-scoreboard {
    margin-bottom: 1rem;
}

.eop-scoreboard-header {
    gap: 1rem;
}

.eop-scoreboard-grid {
    --scoreboard-columns: 1;
    display: grid;
    grid-template-columns: repeat(var(--scoreboard-columns), minmax(0, 1fr));
    gap: 0.75rem;
    align-items: start;
}

.eop-score-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--base--white);
}

.eop-score-table th,
.eop-score-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--primary--200);
    text-align: left;
}

.eop-score-table th {
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--primary--500);
}

.scoreboard-name-input {
    min-width: 12rem;
    max-width: 100%;
    margin: 0;
}

.scoreboard-score {
    font-weight: 700;
    min-width: 5rem;
}

.scoreboard-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.scoreboard-actions .button {
    min-width: 2.25rem;
    justify-content: center;
}

.suit-group {
    margin-bottom: 2rem;
}

.suit-header {
    padding: 0.8rem 1rem;
    color: #fff;
    font-weight: 700;
    font-family: Archia, sans-serif;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.suit-header.suit-S {
    background: var(--suit-s-bg);
    color: var(--suit-s-text);
}

.suit-header.suit-T {
    background: var(--suit-t-bg);
    color: var(--suit-t-text);
}

.suit-header.suit-R {
    background: var(--suit-r-bg);
    color: var(--suit-r-text);
}

.suit-header.suit-I {
    background: var(--suit-i-bg);
    color: var(--suit-i-text);
}

.suit-header.suit-D {
    background: var(--suit-d-bg);
    color: var(--suit-d-text);
}

.suit-header.suit-E {
    background: var(--suit-e-bg);
    color: var(--suit-e-text);
}

.suit-header.suit-P {
    background: var(--suit-p-bg);
    color: var(--suit-p-text);
}

.cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-compact {
    width: 90px;
    border: 1px solid var(--primary--200);
    background: var(--base--white);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, opacity 0.3s, box-shadow 0.2s;
    box-shadow: 0 0 10px -4px #00000026;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 10px -4px #00000026, 0 10px 10px -12.5px #0003;
}

.card-compact img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.card-counter {
    padding: 0.5rem 0.9rem;
    background: var(--primary--900);
    color: var(--base--white);
    font-size: 0.8rem;
    font-weight: 700;
    position: absolute;
    top: 100px;
    right: 3.125rem
}

#host-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 31, 37, 0.93);
    z-index: 1000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#host-overlay img {
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    box-shadow: 0 0 60px #0009;
    object-fit: contain;
}

#close-overlay {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    border: 0;
    background: transparent;
    color: var(--base--white);
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#close-overlay:hover {
    opacity: 1;
}

kbd {
    background: var(--primary--200);
    border: 1px solid var(--primary--500);
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.85em;
    border-radius: 2px;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 31, 37, 0.75);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--base--white);
    color: var(--base--black);
    padding: 2rem;
    max-width: 60rem;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 10px -4px #00000026, 0 40px 40px -20px #0000004d;
    position: relative;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 2rem;
    color: var(--primary--500);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--base--black);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

.eop-modal-header {
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.eop-modal-title {
    margin-bottom: 0 !important;
}

.modal-content h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary--900);
}

.modal-content h4 {
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    color: var(--primary--900);
    font-size: 1rem;
}

.modal-content ul,
.modal-content ol {
    text-align: left;
    line-height: 1.8;
    padding-left: 1.25rem;
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.shortcuts-table td {
    padding: 0.6rem;
    border-bottom: 1px solid var(--primary--200);
    font-size: 0.9rem;
}

.shortcuts-table td:first-child {
    font-weight: 700;
    width: 40%;
}

.card-player:focus {
    outline: 3px solid var(--base--action);
    outline-offset: 3px;
}

@media (max-width: 991px) {
    .eop-col-full {
        flex: 100%;
        max-width: 100%;
    }

    .eop-hero-row {
        row-gap: 1.5rem;
    }

    .eop-surface {
        padding: 1.5rem;
    }
}

@media (max-width: 767px) {
    .eop-topbar {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .eop-footer-bar,
    .eop-panel-header,
    #view-header-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .size-controls {
        width: 100%;
    }

    .eop-chip-row-hero {
        margin-bottom: 0.5rem;
    }

    .card.size-medium {
        width: 280px;
    }

    .card.size-medium img {
        width: 280px;
        height: 395px;
    }

    .card.size-large {
        width: 320px;
    }

    .card.size-large img {
        width: 320px;
        height: 455px;
    }

    .modal-content {
        padding: 1.25rem;
        max-height: 90vh;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    max-width: 400px;
}

.toast {
    background: #333;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out, slideOut 0.3s ease-out 4.7s forwards;
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast.error {
    background: #d32f2f;
    border-left: 4px solid #ff1744;
}

.toast.warning {
    background: #f57c00;
    border-left: 4px solid #ffb300;
}

.toast.success {
    background: #388e3c;
    border-left: 4px solid #4caf50;
}

.toast.info {
    background: #1976d2;
    border-left: 4px solid #2196f3;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
}

.toast.error .toast-icon::before {
    content: '✕';
    font-weight: bold;
}

.toast.warning .toast-icon::before {
    content: '⚠';
}

.toast.success .toast-icon::before {
    content: '✓';
    font-weight: bold;
}

.toast.info .toast-icon::before {
    content: 'ℹ';
    font-weight: bold;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .toast {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Form Validation Styles */
.form__input-field.error {
    border-color: #d32f2f;
    animation: shake 0.4s ease-in-out;
}

.form__input-field.error:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-8px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(8px);
    }
}

.error-message {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 0.4rem;
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.error-message.visible {
    display: block;
}

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