/* Main Stylesheet - Dark Mode Only - Modern Design */

:root {
    /* Modern dark mode colors */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --text-heading: #ffffff;
    --border-color: #2a2a2a;
    --border-light: #333333;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-hover: rgba(0, 0, 0, 0.6);
    --shadow-card: rgba(0, 0, 0, 0.2);
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --warning-bg: #3d2f00;
    --warning-text: #ffd700;
    --link: #60a5fa;
    --link-hover: #93c5fd;
    --accent: #6366f1;
    --accent-hover: #818cf8;
}

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

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Global link styles */
a {
    color: var(--link) !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover) !important;
    text-decoration: underline;
}

a:visited {
    color: var(--link) !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header */
header {
    background: var(--bg-secondary);
    padding: 20px 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--shadow-card);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

header h1 {
    color: var(--text-heading);
    font-size: 1.75em;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.site-logo {
    max-height: 60px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

main {
    flex: 1;
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

footer {
    margin-top: 32px;
    text-align: center;
    color: var(--text-tertiary);
    padding: 24px;
    font-size: 0.875em;
}

footer > p {
    opacity: 0.85;
}

footer .footer-payment-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}

footer .footer-payment-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: 30px;
    object-fit: contain;
}

@media (max-width: 520px) {
    footer .footer-payment-image {
        width: 100%;
        height: auto;
    }
}

footer .legal-links {
    margin-top: 10px;
    font-size: 0.95em;
}

footer .legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer .legal-links a:hover {
    text-decoration: underline;
}

.terms-acceptance {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.terms-acceptance-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--text-primary);
    cursor: pointer;
}

.terms-acceptance-label input {
    margin-top: 4px;
    flex-shrink: 0;
}

.terms-acceptance-label a {
    color: var(--link);
}

/* Event List */
.event-list h2 {
    margin-bottom: 24px;
    color: var(--text-heading);
    font-size: 1.875em;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.event-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0;
    background: var(--bg-tertiary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-direction: column;
}

.event-card:hover {
    box-shadow: 0 8px 24px var(--shadow-hover);
    transform: translateY(-4px);
    border-color: var(--border-light);
}

.event-poster {
    width: 100%;
    overflow: hidden;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.event-poster a {
    display: block;
    text-decoration: none;
}

.event-poster img {
    transition: opacity 0.3s ease;
}

.event-poster:hover img {
    opacity: 0.9;
}

.event-poster img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.event-card h3 {
    color: var(--text-heading);
    margin: 20px 20px 12px 20px;
    text-align: center;
    font-size: 1.25em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.event-card .btn {
    margin: 0 20px 20px 20px;
    text-align: center;
}

.event-date,
.event-venue {
    margin: 8px 20px 16px 20px;
    color: var(--text-secondary);
    font-size: 0.875em;
    text-align: center;
    font-weight: 400;
}

/* Ticket Selection */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 0;
}

.back-link:hover {
    color: var(--link-hover);
    transform: translateX(-4px);
}

.back-link::before {
    content: '←';
    font-size: 1.2em;
}

.message.cancelled {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.message.cancelled h3 {
    margin: 0 0 12px 0;
    color: var(--warning);
    font-weight: 600;
}

.event-header {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    margin-bottom: 48px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.event-poster-section {
    position: sticky;
    top: 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.event-poster-large {
    width: 100%;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    display: block;
    box-sizing: border-box;
    object-fit: contain;
}

.event-info-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.event-info-section h2 {
    margin-top: 0;
    color: var(--text-heading);
    font-size: 2.25em;
    font-weight: 700;
    letter-spacing: -0.03em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    line-height: 1.2;
}

.event-description-formatted {
    margin: 20px 0;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.event-description-formatted p {
    margin: 1em 0;
    padding: 0;
    min-height: 1.2em;
}

.event-description-formatted p:first-child {
    margin-top: 0;
}

.event-description-formatted p:last-child {
    margin-bottom: 0;
}

.event-description-formatted p:empty {
    margin: 0.5em 0;
    min-height: 0;
}

.event-description-formatted br {
    line-height: 1.8;
}

.event-description-formatted img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    border-radius: 4px;
    margin: 10px 0;
    display: block;
    box-sizing: border-box;
}

.event-description-formatted iframe {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 200px;
    border: 0;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.event-description-formatted a {
    color: var(--link);
    text-decoration: underline;
}

.event-description-formatted a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.event-description-formatted h1,
.event-description-formatted h2,
.event-description-formatted h3,
.event-description-formatted h4,
.event-description-formatted h5,
.event-description-formatted h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: bold;
}

.event-description-formatted h1:first-child,
.event-description-formatted h2:first-child,
.event-description-formatted h3:first-child,
.event-description-formatted h4:first-child,
.event-description-formatted h5:first-child,
.event-description-formatted h6:first-child {
    margin-top: 0;
}

.event-description-formatted ul,
.event-description-formatted ol {
    margin: 1em 0;
    padding-left: 2em;
}

.event-description-formatted blockquote {
    border-left: 4px solid var(--link);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
}

.event-description-formatted div {
    margin: 0.5em 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.event-detail {
    margin: 10px 0;
    color: var(--text-tertiary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.event-detail strong {
    color: var(--text-heading);
}

.ticket-selection {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.ticket-selection h3 {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    color: var(--text-heading);
    font-size: 1.5em;
    font-weight: 600;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.ticket-types {
    margin: 30px 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.ticket-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    background: var(--bg-tertiary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.ticket-type:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateY(-2px);
}

.ticket-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
}

.ticket-info h3 {
    margin: 0 0 8px 0;
    color: var(--text-heading);
    font-size: 1.25em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ticket-description {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin: 8px 0;
    line-height: 1.5;
}

.ticket-price {
    font-size: 1.75em;
    font-weight: 700;
    color: var(--success);
    margin: 8px 0;
    letter-spacing: -0.02em;
}

.ticket-availability {
    color: var(--text-tertiary);
    font-size: 0.9em;
    margin-top: 5px;
}

.sold-out {
    color: var(--error);
    font-weight: bold;
}

.ticket-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 0;
}

.ticket-quantity label {
    font-weight: 600;
    color: var(--text-primary);
}

.ticket-quantity input,
.ticket-quantity select {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
}

.ticket-quantity input:focus,
.ticket-quantity select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.ticket-quantity input:focus-visible,
.ticket-quantity select:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible,
.btn:focus-visible,
button:focus-visible,
.language-switcher select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent, #60a5fa);
    outline-offset: 2px;
}

.ticket-quantity input:disabled,
.ticket-quantity select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ticket-quantity-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0a0' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-heading);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none; /* keyboard focus uses :focus-visible below */
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    background: var(--bg-secondary);
}

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

.total-section {
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    text-align: right;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.total-label {
    font-size: 1.25em;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

#total-amount {
    color: var(--success);
    font-size: 1.875em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.total-cny-wrap {
    margin-top: 8px;
    font-size: 1.05em;
    color: var(--text-primary);
}

.total-cny-wrap .rate-note {
    display: block;
    margin-top: 4px;
    font-size: 0.75em;
    color: var(--text-secondary);
    font-weight: 400;
}

#total-amount-cny {
    color: #f59e0b;
    font-weight: 700;
}

.payment-method-section {
    margin-top: 24px;
}

.payment-method-heading {
    display: block;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.payment-method-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-method-option {
    display: block;
    cursor: pointer;
}

.payment-method-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-method-card {
    display: block;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.payment-method-card strong {
    display: block;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.payment-method-card small {
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.4;
}

.payment-method-option input:checked + .payment-method-card {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.06);
}

.payment-method-option input:focus-visible + .payment-method-card {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Manual payment page */
.pay-page {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.pay-page-wide {
    max-width: 880px;
}

.pay-page-back {
    margin-bottom: 20px;
    text-align: left;
}

.pay-page h2 {
    margin-bottom: 8px;
    color: var(--text-heading);
}

.pay-page h3 {
    margin: 0 0 16px;
    color: var(--text-heading);
    font-size: 1.15em;
}

.pay-page-lead {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.pay-order-summary {
    text-align: left;
    margin-bottom: 24px;
}

.pay-order-summary .pay-cny-total .rate-note {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 400;
}

.pay-claim-form-single {
    margin-top: 28px;
    text-align: center;
}

.pay-method-picker {
    border: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
}

.pay-method-picker legend {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-heading);
}

.pay-method-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.copy-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.copy-row .copy-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    line-height: 0;
}

.copy-row .copy-btn.copied {
    border-color: var(--success);
    color: var(--success);
}

.pay-qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    margin-top: 28px;
    text-align: center;
}

.pay-qr-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pay-qr-wrap {
    margin: 0 auto 20px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    display: inline-block;
    max-width: 100%;
}

.pay-qr-image {
    display: block;
    max-width: 260px;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.pay-instructions {
    text-align: left;
    margin: 24px 0 0;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.pay-instructions ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-primary);
    line-height: 1.7;
}

.pay-claim-form {
    margin-top: 0;
    width: 100%;
    max-width: 280px;
}

.pay-claim-form .btn-large {
    width: 100%;
    white-space: normal;
    line-height: 1.35;
    padding: 14px 18px;
}

.cny-amount {
    color: #f59e0b;
    font-weight: 700;
}

@media (max-width: 640px) {
    .pay-qr-grid {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent);
    color: #ffffff !important;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-sizing: border-box;
    letter-spacing: -0.01em;
}

.btn,
.btn *,
.btn a {
    color: #ffffff !important;
}

.btn:hover {
    background: var(--accent-hover);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn:hover,
.btn:hover *,
.btn:hover a {
    color: #ffffff !important;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff !important;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #ffffff !important;
}

.btn-primary,
.btn-primary *,
.btn-primary a {
    color: #ffffff !important;
}

.btn-secondary {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
    color: var(--text-heading) !important;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.125em;
    width: 100%;
}

.btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary) !important;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
    border: 1px solid var(--border-color);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 48px 32px;
}

.whatsapp-contact {
    margin: 20px 0;
    font-size: 1.05em;
    line-height: 1.6;
}

.whatsapp-link {
    color: #25D366 !important;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.whatsapp-link:hover {
    color: #20BA5A !important;
    text-decoration: underline;
}

.whatsapp-link:visited {
    color: #25D366 !important;
}

.success-message h2 {
    color: var(--success);
    margin-bottom: 24px;
    font-size: 2em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.order-details {
    background: var(--bg-tertiary);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
}

.order-details p {
    margin: 10px 0;
    color: var(--text-primary);
}

/* Error Messages */
.error {
    color: var(--error);
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 20px;
    }
    
    header {
        padding: 16px 24px;
    }
    
    main {
        padding: 24px;
    }
    
    .event-header {
        grid-template-columns: 280px 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    html {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    img, video, iframe, embed, object {
        max-width: 100% !important;
        height: auto !important;
    }
    
    table {
        max-width: 100% !important;
        table-layout: fixed;
        word-wrap: break-word;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    header {
        padding: 16px;
        margin-bottom: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    header h1 {
        font-size: 1.5em;
        word-wrap: break-word;
    }
    
    main {
        padding: 20px;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .event-header {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 32px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }
    
    .event-poster-section {
        position: static;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .event-poster-large {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 0;
        display: block;
        box-sizing: border-box;
        object-fit: contain;
    }
    
    .event-info-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        overflow-wrap: break-word;
        word-wrap: break-word;
        box-sizing: border-box;
    }
    
    .event-info-section h2 {
        font-size: 1.5em;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .event-description-formatted {
        max-width: 100%;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        overflow-wrap: break-word;
        word-wrap: break-word;
        box-sizing: border-box;
    }
    
    .event-description-formatted * {
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .event-description-formatted img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        display: block;
    }
    
    .event-description-formatted table {
        max-width: 100% !important;
        width: 100% !important;
        table-layout: fixed;
        word-wrap: break-word;
    }
    
    .event-description-formatted iframe,
    .event-description-formatted video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .ticket-type {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .ticket-quantity {
        width: 100%;
        justify-content: space-between;
    }
    
    .ticket-quantity input,
    .ticket-quantity select {
        width: 100px;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .event-card {
        max-width: 100%;
        overflow: hidden;
    }
    
    .event-card h3 {
        font-size: 1.1em;
        margin: 15px;
        word-wrap: break-word;
    }
    
    .event-card .btn {
        margin: 0 15px 15px 15px;
    }
    
    .total-section {
        padding: 15px;
        text-align: center;
        max-width: 100%;
    }
    
    .btn-large {
        padding: 12px 24px;
        width: 100%;
        max-width: 100%;
    }
    
    .ticket-selection h3 {
        font-size: 1.3em;
        margin-top: 30px;
        padding-top: 20px;
    }
    
    .ticket-selection {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    form {
        max-width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    html {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    img, video, iframe, table {
        max-width: 100% !important;
        height: auto !important;
    }
    
    table {
        table-layout: fixed;
        word-wrap: break-word;
    }
    
    .container {
        padding: 5px;
        max-width: 100%;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    header {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    header h1 {
        font-size: 1.3em;
    }
    
    main {
        padding: 10px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .event-header {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .event-poster-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .event-poster-large {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .event-info-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .event-info-section h2 {
        font-size: 1.3em;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .event-description-formatted {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .event-description-formatted * {
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .event-description-formatted img,
    .event-description-formatted video,
    .event-description-formatted iframe {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .event-description-formatted table {
        max-width: 100% !important;
        width: 100% !important;
        table-layout: fixed;
    }
    
    .ticket-info h3 {
        font-size: 1.1em;
        word-wrap: break-word;
    }
    
    .ticket-price {
        font-size: 1.3em;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95em;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
        display: flex !important;
        z-index: 9999;
    }
}

/* 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;
}

/* Back to Top Button */
/* Language Switcher */
.language-switcher {
    flex-shrink: 0;
    margin-left: 20px;
}

.language-switcher select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.875em;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a0a0a0'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2em;
}

.language-switcher select:hover {
    border-color: var(--border-light);
    background-color: var(--bg-secondary);
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.language-switcher option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    header h1 {
        width: 100%;
    }
    
    .site-logo {
        max-width: 200px;
        width: auto;
        height: auto;
        flex-shrink: 0;
    }
    
    .language-switcher {
        margin-left: 0;
        width: 100%;
        align-self: flex-end;
    }
    
    .language-switcher select {
        width: 100%;
        max-width: 180px;
        margin-left: auto;
    }
}

.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white !important;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
        display: flex !important;
        z-index: 9999;
    }
}

/* Print Styles */
@media print {
    .back-to-top {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
/* === Hard-launch mobile-first polish === */
.marketing-opt-in {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.marketing-opt-in .terms-acceptance-label,
.marketing-opt-in-box .terms-acceptance-label {
  min-height: 44px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
}

@media (max-width: 768px) {
  .btn,
  .btn-primary,
  .btn-large,
  button.btn {
    min-height: 48px;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .terms-acceptance-label,
  .payment-method-option,
  .quantity-controls button {
    min-height: 44px;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px; /* prevent iOS zoom */
    min-height: 48px;
    padding: 12px 14px;
  }

  .register-container,
  .login-container {
    margin: 24px auto !important;
    padding: 24px 16px !important;
    border-radius: 12px !important;
  }

  .header-content {
    gap: 12px;
    flex-wrap: wrap;
  }

  .language-switcher,
  .language-switcher button,
  .language-switcher a,
  .language-switcher select {
    min-height: 44px;
    min-width: 44px;
  }

  .ticket-type-card .quantity-input {
    min-width: 48px;
    min-height: 44px;
    text-align: center;
  }

  .success-message .btn {
    width: 100%;
    box-sizing: border-box;
  }

  .event-list .events-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
