/* Reset and Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    background-color: #ffffff;
    font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #dc2626;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #b91c1c;
    text-decoration: underline;
}

/* Layout Classes (FI-specific) */
.frame-skylark-fi {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.grid-shell-fi {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.stratum-mainflow {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header and Navigation */
header nav .stratum-mainflow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    margin: 0;
}

.logo a {
    text-decoration: none;
    display: inline-block;
    font-size: 2rem;
    font-weight: 700;
    color: #dc2626;
}

.logo a:hover,
.logo a:focus {
    color: #b91c1c;
    text-decoration: none;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 0;
}

.nav-list a {
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-list a[aria-current="page"] {
    color: #dc2626;
    font-weight: 600;
}

.nav-list a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #dc2626;
}

/* Responsible Play Disclosure Panel */
.slab-disclosure-fi {
    background: linear-gradient(135deg, #FFF3E0, #E3F2FD);
    border: 2px solid #dc2626;
    border-radius: 8px;
    margin: 2rem auto 0;
}

.rail-rg-ethos {
    padding: 1rem;
    text-align: center;
}

.rail-rg-ethos p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.rail-rg-ethos p:last-of-type {
    margin-bottom: 0.5rem;
}

.rail-rg-ethos small {
    font-size: 0.8rem;
    color: #666;
    display: block;
}

/* Main Content Sections */
.welcome-section {
    background: linear-gradient(135deg, #ffffff, #fef2f2);
    border-bottom: 1px solid #fecaca;
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23fecaca" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.welcome-container {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-badge {
    display: inline-block;
    background: #dc2626;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.welcome-title {
    margin-bottom: 2rem;
}

.welcome-highlight {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    color: #dc2626;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(220, 38, 38, 0.1);
}

.welcome-subtitle {
    display: block;
    font-size: 1.25rem;
    font-weight: 400;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #fecaca;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.15);
    border-color: #dc2626;
}

.feature-icon {
    font-size: 1.25rem;
}

.feature-text {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.welcome-description {
    font-size: 1.1rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-welcome-primary {
    background: #dc2626;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-welcome-primary:hover,
.btn-welcome-primary:focus {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.btn-welcome-secondary {
    background: white;
    color: #dc2626;
    padding: 1rem 2rem;
    border: 2px solid #dc2626;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-welcome-secondary:hover,
.btn-welcome-secondary:focus {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}


.about, .games, .content {
    padding: 3rem 0;
}

.content {
    max-width: 800px;
    margin: 0 auto;
}

/* Games Section */
.deck-game-trio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tile-gamelet {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tile-gamelet:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.15);
    border-color: #dc2626;
}

.tile-gamelet h3 {
    color: #dc2626;
    margin-bottom: 1rem;
}

.tile-gamelet p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-link,
.btn-playpulse,
.btn-affirm-18,
.btn-decline-18 {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary,
.btn-playpulse,
.btn-affirm-18 {
    background-color: #dc2626;
    color: white;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-playpulse:hover,
.btn-playpulse:focus,
.btn-affirm-18:hover,
.btn-affirm-18:focus {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

.btn-secondary,
.btn-decline-18 {
    background-color: white;
    color: #dc2626;
    border-color: #dc2626;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-decline-18:hover,
.btn-decline-18:focus {
    background-color: #f8fafc;
}

.btn-link {
    background: transparent;
    color: #dc2626;
    border: none;
    padding: 0.5rem;
    text-decoration: underline;
}

.btn-link:hover,
.btn-link:focus {
    color: #b91c1c;
}

/* Age Gate */
.bar-age-18fi {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    padding: 1.5rem;
    z-index: 2000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.bar-age-18fi.hidden {
    display: none;
}

.age-gate-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.age-gate-content h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.age-gate-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid #dc2626;
    padding: 1.5rem;
    z-index: 1500;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.cookie-consent.hidden {
    display: none;
}

.cookie-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #dc2626;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover,
.modal-close:focus {
    background: #f3f4f6;
    color: #dc2626;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

/* Cookie Categories */
.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.cookie-toggle {
    margin-bottom: 0.5rem;
}

.cookie-toggle label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.cookie-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
    margin-right: 0.75rem;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .toggle-slider {
    background-color: #dc2626;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

input:disabled + .toggle-slider {
    background-color: #dc2626;
    opacity: 0.6;
}

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

.toast-soonplay {
    background: white;
    border: 2px solid #dc2626;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}

.toast-content {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.toast-content p {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
}

.toast-closelet {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-closelet:hover,
.toast-closelet:focus {
    background: #f3f4f6;
    color: #dc2626;
}

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

/* Footer */
footer {
    background-color: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-info h3,
.footer-links h4,
.footer-contact h4 {
    color: #dc2626;
    margin-bottom: 1rem;
}

.footer-links ul,
.footer-contact ul {
    list-style: none;
}

.footer-links ul li,
.footer-contact ul li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* Contact Page Styles */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

.contact-methods h3 {
    color: #dc2626;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.contact-methods ul {
    list-style: none;
    margin-bottom: 1rem;
}

.contact-methods ul li {
    margin-bottom: 0.5rem;
}

.contact-form {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group label span[aria-label="required"] {
    color: #dc2626;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc2626;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.success-message {
    background: #f0fdf4;
    border: 2px solid #16a34a;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
}

.success-message h3 {
    color: #16a34a;
    margin-bottom: 1rem;
}

.contact-note {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.contact-note h3 {
    color: #92400e;
    margin-bottom: 0.75rem;
}

.contact-note ul {
    margin-left: 1.5rem;
}

/* Cookie Management */
.cookie-management {
    margin: 2rem 0;
    text-align: center;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.cookie-table th,
.cookie-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #dc2626;
}

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

/* Focus Management */
*:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .welcome-highlight {
        font-size: 2.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .welcome-features {
        gap: 1rem;
    }
    
    .feature-item {
        padding: 0.5rem 1rem;
    }
    
    .welcome-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-welcome-primary,
    .btn-welcome-secondary {
        min-width: 200px;
    }
    
    .deck-game-trio {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .nav-list {
        gap: 1rem;
    }
    
    .age-gate-buttons,
    .cookie-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .age-gate-buttons button,
    .cookie-buttons button {
        min-width: 200px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 480px) {
    .stratum-mainflow,
    .grid-shell-fi {
        padding: 0 0.75rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .welcome-section {
        padding: 2rem 0;
    }
    
    .welcome-highlight {
        font-size: 2rem;
    }
    
    .welcome-features {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .about, .games, .content {
        padding: 2rem 0;
    }
    
    .tile-gamelet {
        padding: 1.5rem;
    }
    
    .rail-rg-ethos {
        padding: 0.75rem;
    }
    
    .rail-rg-ethos p {
        font-size: 0.85rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .slab-disclosure-fi {
        background: #ffffff;
        border: 3px solid #000000;
    }
    
    .hero {
        background: #000000;
        color: #ffffff;
    }
    
    .tile-gamelet {
        border: 2px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .tile-gamelet:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-playpulse:hover,
    .btn-affirm-18:hover {
        transform: none;
    }
}