:root {
    --cafe-claro: #c7a97a;
    --cafe-medio: #b08968;
    --cafe-oscuro: #7f5539;
    --cafe-extra-oscuro: #3d2b1f;
    --cafe-vainilla: #ecd9c3;
    --crema: #f7efe5;
    --blanco-calido: #fffaf5;
    --arena: #efe3d3;
    --sombra-cafe: rgba(80, 48, 23, 0.16);
    --texto-suave: #6f5a46;
    --ease-spring: cubic-bezier(0.22, 1.24, 0.36, 1);
    --dur-press: 120ms;
    --dur-interaction: 180ms;
}

body {
    background-color: var(--crema);
    color: var(--cafe-extra-oscuro);
    font-family: "Work Sans", sans-serif;
    min-height: 100vh;
    position: relative;
}

.site-body {
    display: flex;
    flex-direction: column;
}

.site-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(199, 169, 122, 0.22), transparent 30%),
        radial-gradient(circle at bottom right, rgba(127, 85, 57, 0.12), transparent 28%),
        linear-gradient(180deg, #fbf5ee 0%, #f6ede1 52%, #f2e4d1 100%);
    z-index: -1;
}

.site-container {
    max-width: 1180px;
}

.site-main {
    flex: 1;
    padding: 2rem 0 3rem;
}

.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(86, 56, 34, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 244, 230, 0.15);
    box-shadow: 0 18px 30px rgba(61, 43, 31, 0.16);
}

.site-brand {
    text-decoration: none;
}

.site-brand-logo {
    height: 58px;
    width: auto;
    border-radius: 16px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

.site-brand-text {
    color: var(--crema);
    font-family: "Fraunces", serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.site-nav-list {
    gap: 0.25rem;
    align-items: center;
}

.site-nav-link {
    color: rgba(247, 239, 229, 0.92);
    font-weight: 500;
    border-radius: 999px;
    padding: 0.7rem 1rem !important;
    transition: background-color var(--dur-interaction) ease-out,
        color var(--dur-interaction) ease-out,
        transform var(--dur-interaction) var(--ease-spring);
}

.site-nav-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

@media (hover: hover) and (pointer: fine) {
    .site-nav-link:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }
}

.site-nav-link-accent {
    background: rgba(236, 217, 195, 0.12);
    color: var(--cafe-vainilla);
}

.site-toggler {
    border-color: rgba(255, 245, 233, 0.7);
}

.site-alerts {
    margin-bottom: 1.5rem;
}

.site-alert {
    border: none;
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(61, 43, 31, 0.1);
}

.site-footer {
    background: rgba(61, 43, 31, 0.94);
    color: rgba(247, 239, 229, 0.88);
    padding: 1.2rem 0 1.5rem;
}

.site-footer-title {
    margin: 0;
    font-family: "Fraunces", serif;
    font-size: 1rem;
    font-weight: 700;
}

.site-footer-copy {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
}

.hero-section,
.home-section {
    display: grid;
    gap: 2rem;
}

.hero-section {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: center;
    padding: 2rem 0 1rem;
}

.hero-kicker,
.auth-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: rgba(127, 85, 57, 0.1);
    color: var(--cafe-oscuro);
    border: 1px solid rgba(127, 85, 57, 0.18);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title,
.auth-title,
.section-title {
    font-family: "Fraunces", serif;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.4rem);
    max-width: 15ch;
}

.hero-text,
.auth-text,
.home-section-copy p,
.auth-form-text {
    color: var(--texto-suave);
    font-size: 1.05rem;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.hero-actions-inline {
    margin-top: 1.25rem;
}

.btn-cafe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.95rem 1.45rem;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    color: var(--cafe-extra-oscuro);
    border-radius: 16px;
    border: none;
    border-bottom: 4px solid var(--cafe-medio);
    box-shadow: 0 12px 20px var(--sombra-cafe);
    transition: transform var(--dur-press) var(--ease-spring),
        box-shadow var(--dur-interaction) ease-out,
        background-color var(--dur-interaction) ease-out;
    cursor: pointer;
}

.btn-cafe:focus-visible {
    color: var(--cafe-extra-oscuro);
    box-shadow: 0 16px 24px rgba(80, 48, 23, 0.22);
}

.btn-cafe:active {
    transform: translateY(1px) scale(0.975);
    box-shadow: 0 8px 14px rgba(80, 48, 23, 0.18);
}

@media (hover: hover) and (pointer: fine) {
    .btn-cafe:hover {
        color: var(--cafe-extra-oscuro);
        transform: translateY(-2px);
        box-shadow: 0 16px 24px rgba(80, 48, 23, 0.22);
    }
}

.btn-cafe-primary {
    background: var(--cafe-medio);
    color: #2f2016;
}

.btn-cafe-primary:hover,
.btn-cafe-primary:focus {
    background: #c59b71;
}

.btn-cafe-soft {
    background: var(--blanco-calido);
    border-bottom-color: #d5b491;
    color: var(--cafe-oscuro);
}

.btn-cafe-soft:hover,
.btn-cafe-soft:focus {
    background: #fff2e2;
}

.data-card {
    margin: 1.2rem 0 1.6rem;
    overflow: hidden;
    border: 1px solid rgba(95, 64, 39, 0.22);
    border-radius: 14px;
    background: #f1dfca;
    box-shadow: 0 10px 20px rgba(72, 48, 29, 0.12);
}

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    background: #7f5539;
    color: #f7efe5;
}

.data-card-header h3,
.data-card-title {
    margin: 0;
    color: #f7efe5;
    font-family: "Fraunces", serif;
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    line-height: 1.2;
}

.data-card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(247, 239, 229, 0.16);
    color: #f7efe5;
    font-weight: 700;
}

.data-card-body {
    padding: 0.85rem;
}

.data-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.data-toolbar label {
    margin: 0;
    color: var(--cafe-oscuro);
    font-weight: 700;
}

.data-toolbar select,
.data-toolbar input {
    min-width: min(100%, 260px);
    margin-bottom: 0;
}

.data-table-wrap,
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #f3e6d6 !important;
}

.data-table th,
.data-table td {
    padding: 0.58rem 0.65rem !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(124, 86, 54, 0.2) !important;
    color: #4f3725;
    text-align: left !important;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.32;
    font-size: 0.9rem;
}

.data-table th {
    background: #d8c2a8 !important;
    color: #3d2b1f !important;
    font-weight: 800;
    font-size: 0.84rem;
    line-height: 1.2;
}

.data-table tbody tr:nth-child(even) {
    background: #ead8c1 !important;
}

.data-table tbody tr:hover {
    background: #e3ccb1 !important;
}

.data-table td:first-child {
    background: transparent !important;
    color: #5d3f2a !important;
    font-weight: 700;
}

.data-table th:last-child,
.data-table td:last-child {
    width: 1%;
    min-width: 132px;
    white-space: normal;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.32rem;
    max-width: 180px;
}

.actions-row form {
    display: inline-flex;
    margin: 0;
}

.actions-row .btn,
.actions-row .btn-small {
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0.38rem 0.55rem;
    border-radius: 7px;
    font-size: 0.78rem;
    line-height: 1.1;
}

.btn.btn-danger,
.btn-danger {
    background: #9f3d35;
    color: #fff;
}

.btn.btn-danger:hover,
.btn-danger:hover {
    background: #7f2f29;
    color: #fff;
}

.btn.btn-muted,
.btn-muted {
    background: #d8c2a8;
    color: #5c4033;
}

.btn.btn-muted:hover,
.btn-muted:hover {
    background: #c9ad8d;
    color: #5c4033;
}

.btn-icon {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-pill,
.estatus-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.1;
}

@media (max-width: 760px) {
    .data-card {
        border-radius: 12px;
    }

    .data-card-header,
    .data-card-body {
        padding: 1rem;
    }

    .data-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 0.55rem !important;
    }

    .actions-row {
        max-width: 160px;
    }
}

.btn-datos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cafe-vainilla);
    padding: 14px 18px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    color: var(--cafe-oscuro);
    border-radius: 16px;
    border-bottom: 5px solid var(--cafe-medio);
    box-shadow: 0 12px 20px var(--sombra-cafe);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-datos:hover {
    background: var(--crema);
    color: var(--cafe-oscuro);
    transform: translateY(-2px);
}

.btn-datos:active {
    transform: translateY(1px) scale(0.975);
    box-shadow: 0 6px 10px rgba(61, 43, 31, 0.18);
    border-bottom: 2px solid var(--cafe-medio);
}

@media (hover: hover) and (pointer: fine) {
    .btn-datos:hover {
        background: var(--crema);
        color: var(--cafe-oscuro);
        transform: translateY(-2px);
    }
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
}

.hero-meta-card,
.home-highlight-card,
.auth-card,
.auth-visual-card {
    background: rgba(255, 250, 245, 0.86);
    border: 1px solid rgba(176, 137, 104, 0.16);
    border-radius: 24px;
    box-shadow: 0 20px 30px rgba(80, 48, 23, 0.08);
    backdrop-filter: blur(8px);
}

.hero-meta-card {
    padding: 1rem 1.05rem;
}

.hero-meta-card strong {
    display: block;
    margin-bottom: 0.35rem;
    font-family: "Fraunces", serif;
    font-size: 1.05rem;
}

.hero-meta-card span {
    color: var(--texto-suave);
    line-height: 1.55;
}

.hero-visual {
    position: relative;
    padding: 1rem 0 2rem;
}

.fancy-frame {
    position: relative;
    border-radius: 28px;
    padding: 14px;
    background: linear-gradient(135deg, #fff 0%, #f5ead9 100%);
    box-shadow: 0 18px 36px rgba(61, 43, 31, 0.16), inset 0 3px 10px rgba(255,255,255,0.6);
    overflow: hidden;
}

.fancy-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
}

.fancy-frame-large {
    max-width: 500px;
    margin-left: auto;
}

.hero-floating-card {
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(280px, 70%);
    background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(244, 230, 211, 0.96));
    border: 1px solid rgba(127, 85, 57, 0.16);
    border-radius: 24px;
    box-shadow: 0 20px 35px rgba(61, 43, 31, 0.14);
    padding: 1rem;
}

.hero-floating-card img {
    width: 100%;
    max-width: 150px;
    display: block;
    margin: 0 auto 0.75rem;
}

.hero-floating-card p {
    margin: 0;
    color: var(--texto-suave);
    line-height: 1.55;
}

.home-section {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.92fr);
    align-items: center;
    padding: 2rem 0 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.home-highlight-card {
    overflow: hidden;
}

.home-banner {
    width: 100%;
    display: block;
    max-height: 260px;
    object-fit: cover;
}

.home-highlight-content {
    padding: 1.4rem 1.5rem 1.6rem;
}

.home-highlight-content h3 {
    font-family: "Fraunces", serif;
    margin-bottom: 1rem;
}

.feature-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--texto-suave);
    line-height: 1.8;
}

.home-mascot {
    text-align: center;
    padding-top: 1rem;
}

.home-mascot img {
    max-width: 180px;
    width: 100%;
}

/* .auth-shell layout is handled by brand-pages.css */

.auth-panel {
    min-width: 0;
}

.auth-panel-visual {
    padding: 1.5rem 0.5rem 1rem 0;
}

.auth-title {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    max-width: 11ch;
    margin-bottom: 1rem;
}

.auth-visual-card {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    margin-top: 1.5rem;
}

.auth-visual-image {
    width: 100%;
    border-radius: 18px;
    object-fit: cover;
    background: linear-gradient(180deg, #f7efe5, #ead7c0);
}

.auth-visual-copy {
    display: grid;
    gap: 0.35rem;
}

.auth-visual-copy strong {
    font-family: "Fraunces", serif;
    font-size: 1.1rem;
}

.auth-visual-copy span {
    color: var(--texto-suave);
}

.auth-panel-form {
    display: flex;
    align-items: center;
}

.auth-card {
    width: 100%;
    padding: 1.8rem;
}

.auth-form-title {
    font-family: "Fraunces", serif;
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

.auth-form {
    display: grid;
    gap: 0.85rem;
}

.auth-form label,
.auth-role-group legend {
    font-weight: 600;
    color: var(--cafe-oscuro);
}

.auth-input {
    border-radius: 16px;
    border: 1px solid rgba(176, 137, 104, 0.35);
    padding: 0.85rem 1rem;
    box-shadow: none;
}

.auth-input:focus {
    border-color: rgba(127, 85, 57, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(176, 137, 104, 0.18);
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.8rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cafe-oscuro);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus {
    background: rgba(127, 85, 57, 0.1);
    outline: none;
}

.password-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-role-group {
    border: none;
    padding: 0;
    margin: 0.25rem 0 0;
}

.auth-role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.65rem;
}

.auth-role-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.95rem 0.85rem;
    border-radius: 16px;
    background: rgba(247, 239, 229, 0.9);
    border: 1px solid rgba(176, 137, 104, 0.22);
    cursor: pointer;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.5rem;
}

.auth-submit {
    width: 100%;
    margin-top: 0;
}

.auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cafe-oscuro);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.auth-link:hover,
.auth-link:focus {
    color: var(--cafe-extra-oscuro);
    opacity: 0.9;
}

#game-area {
    background: #e9f5dd;
    border-color: var(--cafe-medio);
}

#score {
    color: var(--cafe-extra-oscuro);
}

.card {
    border-radius: 20px;
}

@media (max-width: 991.98px) {
    .hero-section,
    .home-section,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .hero-title,
    .auth-title {
        max-width: none;
    }

    .hero-visual {
        padding-bottom: 0;
    }

    .fancy-frame-large {
        margin: 0 auto;
    }

    .hero-floating-card {
        position: relative;
        width: 100%;
        max-width: 380px;
        margin: 1rem auto 0;
    }

    .auth-panel-visual {
        padding-right: 0;
    }
}

@media (max-width: 767.98px) {
    .site-main {
        padding-top: 1.25rem;
    }

    .site-brand-text {
        font-size: 1rem;
    }

    .hero-meta,
    .auth-role-options {
        grid-template-columns: 1fr;
    }

    .auth-card,
    .home-highlight-content {
        padding: 1.2rem;
    }
}

.app-module-layout {
    display: grid;
    grid-template-columns: minmax(210px, 235px) minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
}

.app-module-layout-public {
    display: block;
}

.app-module-content {
    min-width: 0;
}

.app-sidebar {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 6.75rem);
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #dce5d8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(38, 56, 45, .1);
    scrollbar-color: #b6c9ad transparent;
}

.app-sidebar-heading {
    display: grid;
    gap: .2rem;
    margin-bottom: .8rem;
    padding: .75rem;
    border-radius: 12px;
    background: #2e5134;
    color: #fff;
    overflow-wrap: anywhere;
}

.app-sidebar-heading span {
    color: #e8efe4;
    font-size: .84rem;
}

.app-sidebar-menu {
    display: grid;
    gap: .4rem;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    min-height: 2.55rem;
    padding: .55rem .7rem;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #35483a;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus-visible {
    border-color: #dce5d8;
    background: #f1f5ee;
    color: #244832;
}

.app-sidebar-link.is-active {
    border-color: #d5e1d1;
    background: #e8efe4;
    color: #244832;
    font-weight: 700;
}

.app-module-content .dashboard-wrapper {
    display: block;
    min-width: 0;
    margin: 0;
}

.app-module-content .dashboard-wrapper > .sidebar-3d {
    display: none !important;
}

.app-module-content .dashboard-content {
    min-width: 0;
    margin: 0;
    padding: 0;
}

@media (max-width: 767.98px) {
    .app-module-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .app-sidebar {
        position: static;
        max-height: 18rem;
    }

    .app-sidebar-menu {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar-link {
        transition: none;
    }
}
