/* Base styles for Wedding RSVP App */

:root {
    --primary-color: #020617;
    --secondary-color: #0b1220;
    --accent-color: #7dfd7d;
    --text-color: #b8ffb8;
    --muted-text: #9ae6aa;
    --bg-color: #03050c;
    --panel-bg: rgba(0, 0, 0, 0.86);
    --border-color: rgba(125, 253, 125, 0.25);
    --button-bg: #22ff76;
    --button-text: #04110c;
    --success-color: #8bdf86;
    --error-color: #f87171;
    --spacing-unit: 1rem;
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: "Share Tech Mono", "Roboto Mono", "Fira Code", Consolas, "Courier New", monospace;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at top left, rgba(34, 255, 118, 0.08), transparent 35%),
                      radial-gradient(circle at bottom right, rgba(125, 253, 125, 0.05), transparent 28%);
}

body {
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-unit);
}

/* Hero Section */
.hero,
.hero-banner {
    text-align: center;
    padding: 4rem var(--spacing-unit) 3rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(71, 85, 105, 0.95));
    color: var(--text-color);
    border-radius: 1rem;
    box-shadow: 0 14px 40px rgba(8, 14, 36, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.hero h1,
.hero-banner h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero .subtitle,
.hero-banner .subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Button Styles */
.button {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    text-align: center;
    background-color: var(--button-bg);
    color: var(--button-text);
    box-shadow: 0 0 0 1px rgba(125, 253, 125, 0.12), 0 10px 30px rgba(34, 255, 118, 0.12);
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(125, 253, 125, 0.18), 0 14px 32px rgba(34, 255, 118, 0.18);
}

.button-primary,
.button-secondary,
.button-tertiary {
    background-color: var(--button-bg);
    color: var(--button-text);
}

.button-group {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.button-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.button-row .button,
.button-group .button {
    flex: 1 1 150px;
    min-width: 150px;
}

/* Form Styles */
.form-container {
    max-width: 760px;
    width: min(100%, 760px);
    margin: 3rem auto;
    padding: 2rem;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.form-container h1 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--accent-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--muted-text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 0.85rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

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

.form-group input[readonly],
.form-group textarea[readonly] {
    background: #f4f4f4;
    color: #666;
    cursor: not-allowed;
}

.input-hint {
    margin-top: 0.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.privacy-note {
    margin-bottom: 1.5rem;
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.tooltip-icon {
    display: inline-block;
    margin-left: 0.4rem;
    color: #94a3b8;
    border-bottom: 1px dotted currentColor;
    cursor: help;
    font-size: 0.95rem;
    line-height: 1;
}

.email-check {
    color: #cbd5e1;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.radio-label input[type="radio"] {
    margin-right: 0.75rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

button[type="submit"] {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
}

.button-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.person-block {
    background: rgba(8, 14, 27, 0.96);
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.person-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.button-secondary {
    background-color: rgba(34, 255, 118, 0.12);
    color: var(--accent-color);
    border: 1px solid rgba(125, 253, 125, 0.25);
}

.button-secondary:hover {
    background-color: rgba(34, 255, 118, 0.18);
}

.banner {
    background: rgba(0, 0, 0, 0.9);
    color: var(--accent-color);
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.content-box {
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.lounge-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 2fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.room-box {
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.room-header {
    margin-bottom: 1rem;
}

#game-container {
    width: 100%;
    min-height: 500px;
    background-color: #101827;
    border-radius: 1rem;
    overflow: hidden;
}

/* Messages */
.success-message {
    padding: 1rem;
    margin-top: 2rem;
    background-color: #d1fae5;
    border: 2px solid var(--success-color);
    border-radius: 0.5rem;
    color: #065f46;
    text-align: center;
}

.success-message p {
    margin: 0.5rem 0;
}

.error-message {
    padding: 1rem;
    margin-top: 1rem;
    background-color: #fee2e2;
    border: 2px solid var(--error-color);
    border-radius: 0.5rem;
    color: #7f1d1d;
}

/* Room Container */
.room-container {
    padding: 0 !important;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom: 4px solid var(--accent-color);
}

.room-header h1 {
    font-size: 2rem;
}

.room-controls {
    display: flex;
    align-items: center;
    gap: 2rem;
}

#game-container {
    width: 100%;
    background-color: #1a1a1a;
    min-height: 600px;
}

.avatar-editor-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.5fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.avatar-preview-card,
.avatar-controls-card {
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.avatar-preview-card h2,
.avatar-controls-card h2 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.avatar-preview-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 360px;
    background: linear-gradient(180deg, rgba(16, 25, 49, 0.95), rgba(6, 9, 18, 0.9));
    border-radius: 1rem;
    border: 1px solid rgba(124, 252, 145, 0.18);
}

.avatar-preview-stage canvas {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    background-color: #ffffff;
}

.avatar-controls-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avatar-section {
    background: rgba(8, 14, 27, 0.95);
    border: 1px solid rgba(125, 253, 125, 0.15);
    border-radius: 1rem;
    padding: 1rem;
}

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

.style-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.arrow-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.style-label {
    min-width: 90px;
    text-align: center;
    font-weight: 700;
    color: var(--text-color);
}

.arrow-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(125, 253, 125, 0.25);
    background: rgba(34, 255, 118, 0.08);
    color: var(--accent-color);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.arrow-button:hover {
    background: rgba(34, 255, 118, 0.16);
    transform: translateY(-1px);
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.color-swatch {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.color-swatch.selected {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.save-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.save-actions .button {
    flex: 1 1 220px;
}

.edit-avatar-note {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 0.85rem;
    background: rgba(16, 24, 39, 0.95);
    color: #d7ffd7;
}

/* Avatar Popup */
.avatar-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 200px;
    text-align: center;
}

.room-claims-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.room-claims-grid label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.accommodation-section {
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    border: 1px solid rgba(125, 253, 125, 0.2);
    border-radius: 0.85rem;
    background: rgba(8, 14, 27, 0.85);
}

.accommodation-section h2 {
    margin-bottom: 0.4rem;
    color: var(--accent-color);
    font-size: 1.2rem;
}

#accommodation-payment-details {
    font-weight: 400;
    letter-spacing: 0;
    text-align: left;
    color: #d7ffd7;
}

#accommodation-payment-details p {
    margin: 0.4rem 0;
}

#accommodation-payment-details strong {
    color: var(--accent-color);
    font-weight: 700;
}

.room-claims-grid input[type="number"] {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid rgba(125, 253, 125, 0.22);
    border-radius: 0.7rem;
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-color);
}

.popup-content {
    position: relative;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
}

.close-btn:hover {
    opacity: 0.7;
}

.game-modal-content {
    max-width: 720px;
    margin: 0 auto;
}

.game-modal-form {
    margin-top: 1rem;
}

.game-modal-form input {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.8rem;
    border: 1px solid rgba(125, 253, 125, 0.25);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.75);
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.game-modal-errors {
    min-height: 1.5rem;
    color: var(--error-color);
    margin: 0.5rem 0;
}

.hyperwarp-panel {
    max-width: 980px;
}

.hyperwarp-game-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.hyperwarp-game {
    position: relative;
    width: min(92vw, 900px);
    height: 320px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(2, 6, 23, 1));
    border: 2px solid rgba(148, 163, 184, 0.4);
    border-radius: 0.75rem;
    overflow: hidden;
}

.hyperwarp-lane {
    position: absolute;
    left: 0;
    right: 0;
    height: 33.333%;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    opacity: 0.8;
}

.hyperwarp-lane-0 { top: 0; }
.hyperwarp-lane-1 { top: 33.333%; }
.hyperwarp-lane-2 { top: 66.666%; }

.hyperwarp-player {
    position: absolute;
    left: 50%;
    top: 62%;
    width: 24px;
    height: 36px;
    background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 18px rgba(148, 163, 184, 0.45);
    z-index: 3;
}

.hyperwarp-finish {
    position: absolute;
    left: 82%;
    top: 4%;
    width: 18px;
    height: 92%;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.85), rgba(22, 163, 74, 0.85));
    border-radius: 4px;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
    z-index: 2;
}

.hyperwarp-obstacle-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.hyperwarp-obstacle {
    position: absolute;
    display: block;
    border-radius: 4px;
    transform: translate(-50%, 0);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
}

.hyperwarp-star {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%);
}

.hyperwarp-rock {
    background: linear-gradient(180deg, #d97706 0%, #7c2d12 100%);
}

.hyperwarp-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.hyperwarp-timer {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-color);
}

.hyperwarp-results {
    margin-top: 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(125, 253, 125, 0.18);
    border-radius: 0.75rem;
    padding: 1rem;
    line-height: 1.8;
}

.bride-l-board {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.bride-l-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bride-l-row-boxes {
    display: flex;
    gap: 0.35rem;
}

.bride-l-box {
    width: 2.2rem;
    height: 2.2rem;
    border: 2px solid #ffffff;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b1220;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: #ffffff;
}

.bride-l-box-filled {
    background: #ffffff;
}

.bride-l-row-meta {
    min-width: 170px;
    text-align: right;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.bride-l-secret-answer {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(125, 253, 125, 0.22);
}

.bride-l-secret-label {
    margin-bottom: 0.45rem;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.bride-l-secret-box {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

#popup-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .room-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .room-controls {
        width: 100%;
        justify-content: space-between;
    }

    .form-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .button {
        display: block;
        width: 100%;
    }

    .room-controls {
        flex-direction: column;
        gap: 1rem;
    }
}
