/* === Mi Mundo Poni — Design System === */

:root {
    /* Palette */
    --green:       #7a9e7e;
    --green-light: #b5c9a8;
    --brown:       #8b6f47;
    --brown-light: #c4a97d;
    --cream:       #faf5eb;
    --pink:        #e8b4b8;
    --pink-light:  #f5d5d8;
    --white:       #ffffff;
    --text:        #4a3f35;
    --text-light:  #7a6f63;
    --danger:      #c0392b;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Borders */
    --radius:    12px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow:    0 2px 8px rgba(74, 63, 53, 0.1);
    --shadow-lg: 0 4px 16px rgba(74, 63, 53, 0.15);
}

/* === Reset === */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === Base === */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--cream);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--brown);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 4px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Layout === */

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* === Skip link === */

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--green);
    color: var(--white);
    padding: var(--space-xs) var(--space-md);
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: 600;
    z-index: 200;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* === Header === */

.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.site-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brown) !important;
    text-decoration: none !important;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-md);
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--green-light);
    color: var(--brown);
    text-decoration: none;
}

.nav-logout {
    color: var(--text-light) !important;
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    flex-direction: column;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s;
}

/* === Main === */

main.container {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-2xl);
}

/* === Footer === */

.site-footer {
    text-align: center;
    padding: var(--space-lg) 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* === Flash messages === */

.flash {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    margin-bottom: var(--space-lg);
    font-weight: 500;
}

.flash-success {
    background: var(--green-light);
    color: var(--brown);
}

.flash-error {
    background: #f8d7da;
    color: var(--danger);
}

/* === Cards === */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
}

/* === Buttons === */

.btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-primary:hover {
    background: #6b8e6f;
}

.btn-secondary {
    background: var(--brown-light);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--brown);
}

.btn-pink {
    background: var(--pink);
    color: var(--white);
}

.btn-pink:hover {
    background: #d9a0a5;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.9rem;
}

/* === Forms === */

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--brown);
}

.form-control {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--green-light);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(122, 158, 126, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* === Dashboard === */

.dashboard-welcome {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.dashboard-welcome h1 {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.dashboard-welcome p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--green);
}

.stat-card .stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

/* Dashboard content sections */

.dashboard-section {
    margin-bottom: var(--space-2xl);
}

.dashboard-section h2 {
    margin-bottom: var(--space-md);
}

.dashboard-featured-horse {
    display: flex;
    gap: 0;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    padding: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-featured-horse:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.dashboard-featured-horse .horse-card-image {
    flex-shrink: 0;
    width: 220px;
    min-height: 160px;
}

.dashboard-featured-horse .horse-card-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.dashboard-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.dashboard-gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--green-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.dashboard-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === Login === */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--cream);
    padding: var(--space-md);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-header h1 {
    font-size: 2rem;
    color: var(--brown);
    margin-bottom: var(--space-xs);
}

.login-header p {
    color: var(--text-light);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-md);
}

.login-card h2 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--green-light);
}

.login-divider {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: var(--space-md) 0;
}

/* === Setup === */

.setup-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--cream);
    padding: var(--space-md);
}

.setup-container {
    width: 100%;
    max-width: 480px;
}

/* === Page header === */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-header h1 {
    margin: 0;
}

.back-link {
    display: inline-block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.back-link:hover {
    color: var(--green);
}

/* === Empty state === */

.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-light);
}

/* === Horse grid (listing) === */

.horse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.horse-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    padding: 0;
}

.horse-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.horse-card-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--green-light);
}

.horse-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.horse-card-body {
    padding: var(--space-md);
}

.horse-card-body h3 {
    margin-bottom: var(--space-xs);
}

.horse-card-meta {
    display: flex;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: var(--space-xs);
}

.horse-tipo {
    background: var(--green-light);
    color: var(--brown);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.horse-raza {
    padding: 2px 0;
}

.badge-private {
    display: inline-block;
    background: var(--pink-light);
    color: var(--brown);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: var(--space-xs);
}

/* === Horse placeholder === */

.horse-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-light);
    width: 100%;
    height: 100%;
    min-height: 160px;
    font-size: 3rem;
    opacity: 0.6;
}

.horse-placeholder-lg {
    min-height: 300px;
    font-size: 5rem;
    border-radius: var(--radius-lg);
}

/* === Stars === */

.star-display {
    display: inline-flex;
    gap: 2px;
}

.star-display .star {
    color: var(--green-light);
    font-size: 1rem;
}

.star-display .star.filled {
    color: var(--brown-light);
}

.star-display-lg .star {
    font-size: 1.4rem;
}

.star-rating {
    display: inline-flex;
    gap: 4px;
    cursor: pointer;
}

.star-rating .star {
    color: var(--green-light);
    font-size: 1.6rem;
    transition: color 0.15s;
    cursor: pointer;
    user-select: none;
}

.star-rating .star.filled,
.star-rating .star.hover {
    color: var(--brown-light);
}

/* === Horse detail === */

.horse-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.horse-detail-header .back-link {
    margin-bottom: 0;
}

.horse-detail-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.horse-detail-hero {
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-height: 500px;
}

.horse-hero-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.horse-detail-info {
    margin-bottom: var(--space-lg);
}

.horse-detail-info h1 {
    margin-bottom: var(--space-sm);
}

.horse-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--green-light);
    border-bottom: 1px solid var(--green-light);
}

.horse-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.meta-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-weight: 500;
    color: var(--text);
}

.horse-section {
    margin-top: var(--space-lg);
}

.horse-section h3 {
    margin-bottom: var(--space-sm);
    font-size: 1rem;
    color: var(--green);
}

.horse-section p {
    line-height: 1.7;
}

/* === Horse gallery strip === */

.horse-gallery {
    margin-top: var(--space-lg);
}

.horse-gallery h2 {
    margin-bottom: var(--space-md);
}

.horse-gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.horse-gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--green-light);
}

.horse-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-badge {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--brown);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-principal {
    background: var(--brown-light);
    color: var(--white);
}

/* === Horse form === */

.horse-form-page h1 {
    margin-bottom: var(--space-lg);
}

.horse-form {
    max-width: 680px;
}

.horse-form hr {
    border: none;
    border-top: 1px solid var(--green-light);
    margin: var(--space-lg) 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.inline-form {
    display: inline;
}

/* === Image upload === */

.image-upload-area {
    position: relative;
    border: 2px dashed var(--green-light);
    border-radius: var(--radius);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: var(--green);
    background: rgba(122, 158, 126, 0.05);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-light);
}

.upload-icon {
    font-size: 2rem;
}

.upload-placeholder small {
    font-size: 0.8rem;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.image-preview-grid:empty {
    display: none;
}

.image-preview-item {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--green-light);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-tipos-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.image-tipos-list:empty {
    display: none;
}

.image-tipo-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
}

.image-tipo-row select {
    padding: 4px 8px;
    border: 1px solid var(--green-light);
    border-radius: 6px;
    font-size: 0.85rem;
}

/* === Existing images (edit form) === */

.existing-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.existing-image-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--green-light);
}

.existing-image-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.delete-image-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    color: var(--danger);
    cursor: pointer;
}

.delete-image-label input {
    accent-color: var(--danger);
}

/* === Button danger === */

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

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

/* === Gallery filters === */

.gallery-filters {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-tab {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-light);
    background: var(--white);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.filter-tab:hover {
    color: var(--green);
    text-decoration: none;
}

.filter-tab.active {
    background: var(--green);
    color: var(--white);
    text-decoration: none;
}

.filter-horse-select {
    padding: var(--space-xs) var(--space-sm);
    border: 2px solid var(--green-light);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
    margin-left: auto;
}

/* === Gallery grid === */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--green-light);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-overlay .gallery-badge {
    position: static;
    flex-shrink: 0;
}

.gallery-private-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
}

/* === Lightbox === */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--white);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    padding: var(--space-xs);
    z-index: 1001;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--white);
    font-size: 3rem;
    cursor: pointer;
    padding: var(--space-md);
    z-index: 1001;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: var(--space-sm);
}

.lightbox-next {
    right: var(--space-sm);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    gap: var(--space-md);
}

.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.lightbox-info {
    text-align: center;
    color: var(--white);
    max-width: 600px;
}

.lightbox-info h3 {
    color: var(--white);
    margin-bottom: var(--space-xs);
    font-size: 1.2rem;
}

.lightbox-info .gallery-badge {
    position: static;
    display: inline-block;
    margin-bottom: var(--space-sm);
}

.lightbox-info p {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.5;
}

.lightbox-info p:empty {
    display: none;
}

.lightbox-horse {
    margin-top: var(--space-xs);
    font-style: italic;
    opacity: 0.7;
}

.lightbox-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-sm);
}

/* === Journal === */

.journal-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-width: 720px;
    margin: 0 auto;
}

.journal-card {
    display: flex;
    gap: var(--space-md);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.journal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.journal-card-thumb {
    flex-shrink: 0;
    width: 140px;
    min-height: 120px;
    overflow: hidden;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--green-light);
}

.journal-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.journal-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.journal-card-body h3 {
    margin: 0;
    font-size: 1.1rem;
}

.journal-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.journal-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.journal-card-horses {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-top: auto;
}

/* Mood badge */

.mood-badge {
    display: inline-block;
    background: var(--pink-light);
    color: var(--brown);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Mood picker (form) */

.mood-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.mood-picker-btn {
    padding: var(--space-xs) var(--space-md);
    border: 2px solid var(--green-light);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mood-picker-btn:hover {
    border-color: var(--green);
    background: rgba(122, 158, 126, 0.05);
}

.mood-picker-btn.active {
    border-color: var(--green);
    background: var(--green-light);
    font-weight: 600;
}

/* Horse tag pill */

.horse-tag {
    display: inline-block;
    background: var(--green-light);
    color: var(--brown);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

a.horse-tag:hover {
    background: var(--green);
    color: var(--white);
    text-decoration: none;
}

/* Journal detail */

.journal-detail-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    color: var(--text-light);
    margin: var(--space-sm) 0;
    flex-wrap: wrap;
}

.journal-detail-horses {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.journal-body {
    margin-top: var(--space-lg);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Horse checkboxes grid */

.horse-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
}

/* === Settings === */

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 600px;
    margin-top: var(--space-lg);
}

.settings-card h2 {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--green-light);
    font-size: 1.1rem;
}

.friend-code-display {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--cream);
    border-radius: var(--radius);
}

.friend-code-display code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--brown);
    letter-spacing: 1px;
}

.form-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

/* === Horse carousel === */

.horse-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--green-light);
    margin-bottom: var(--space-lg);
    max-height: 500px;
}

.horse-carousel-slide {
    display: none;
}

.horse-carousel-slide.active {
    display: block;
}

.horse-carousel-slide img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    line-height: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 0.95);
}

.carousel-prev {
    left: var(--space-sm);
}

.carousel-next {
    right: var(--space-sm);
}

.carousel-dots {
    position: absolute;
    bottom: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.carousel-dot.active {
    background: var(--white);
}

.carousel-badge {
    position: absolute;
    bottom: var(--space-sm);
    left: var(--space-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--brown);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

/* === Game === */

.game-menu {
    text-align: center;
}

.game-menu-intro {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: var(--space-lg);
}

.game-mode-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    max-width: 720px;
    margin: 0 auto;
}

.game-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-lg);
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    background: var(--white);
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.game-mode-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-light);
}

.game-mode-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.game-mode-card strong {
    font-size: 1.1rem;
    color: var(--brown);
}

.game-mode-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

.game-play {
    max-width: 600px;
    margin: 0 auto;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    font-size: 1rem;
}

.game-score strong {
    color: var(--green);
    font-size: 1.2rem;
}

.game-round strong {
    color: var(--brown);
}

.game-question {
    text-align: center;
    padding: var(--space-xl);
}

.game-prompt-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--brown);
    margin-bottom: var(--space-lg);
}

.game-prompt-text span {
    color: var(--green);
}

.game-prompt-image {
    max-width: 320px;
    margin: 0 auto var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.game-options-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.game-options-names {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
    margin: 0 auto;
}

.game-option {
    border: 3px solid var(--green-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
    background: var(--white);
    overflow: hidden;
}

.game-option:hover {
    transform: translateY(-2px);
    border-color: var(--green);
}

.game-option img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.game-option-name {
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    text-align: center;
    font-family: inherit;
    width: 100%;
}

.game-option-correct {
    border-color: var(--green) !important;
    background: rgba(122, 158, 126, 0.15);
    transform: scale(1.03);
}

.game-option-wrong {
    border-color: var(--danger) !important;
    animation: shake 0.4s ease;
}

.game-option-dimmed {
    opacity: 0.4;
    pointer-events: none;
}

.game-answered .game-option {
    pointer-events: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.game-feedback {
    margin-top: var(--space-md);
    font-weight: 600;
    font-size: 1rem;
    min-height: 1.5em;
}

.game-feedback-correct {
    color: var(--green);
}

.game-feedback-wrong {
    color: var(--danger);
}

.game-results {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-2xl);
}

.game-results-emoji {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: var(--space-md);
}

.game-results-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: var(--space-sm);
}

.game-results-message {
    font-size: 1.2rem;
    color: var(--brown);
    font-weight: 600;
    margin-bottom: var(--space-xl);
}

.game-results-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

/* === Responsive === */

@media (max-width: 768px) {
    .dashboard-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

    main.container {
        padding-left: var(--space-sm);
        padding-right: var(--space-sm);
    }
}

@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: var(--space-md);
        box-shadow: var(--shadow);
        gap: var(--space-xs);
    }

    .nav-links.open {
        display: flex;
    }

    .site-header .container {
        position: relative;
    }

    h1 { font-size: 1.5rem; }
    .dashboard-welcome h1 { font-size: 1.6rem; }

    .form-row {
        grid-template-columns: 1fr;
    }

    .horse-grid {
        grid-template-columns: 1fr;
    }

    .horse-detail-header {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .horse-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .horse-gallery-strip {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .dashboard-featured-horse {
        flex-direction: column;
    }

    .dashboard-featured-horse .horse-card-image {
        width: 100%;
        height: 180px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .dashboard-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .horse-grid {
        gap: var(--space-sm);
    }

    .gallery-grid {
        gap: var(--space-sm);
    }

    .journal-card {
        flex-direction: column;
    }

    .journal-card-thumb {
        width: 100%;
        height: 160px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .carousel-prev,
    .carousel-next {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .gallery-item-overlay {
        opacity: 1;
    }

    .lightbox-nav {
        font-size: 2rem;
        padding: var(--space-sm);
    }

    .lightbox-content {
        max-width: 95vw;
    }

    .lightbox-img {
        max-height: 60vh;
    }

    .game-mode-cards {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .game-mode-card {
        padding: var(--space-lg) var(--space-md);
    }

    .game-prompt-text {
        font-size: 1.2rem;
    }

    .game-prompt-image {
        max-width: 240px;
    }

    .game-options-images {
        gap: var(--space-sm);
    }

    .game-results-actions {
        flex-direction: column;
    }
}
