:root {
    --color-bg: #1a1a1a;
    --color-surface: #2a2a2a;
    --color-surface-light: #363636;
    --color-primary: #ff6b35;
    --color-primary-dark: #E5512A;
    --color-text: #f5f5f5;
    --color-text-dim: #999;
    --color-border: #404040;
    --color-success: #00d9a3;
    --color-warning: #ffc107;
    
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'IBM Plex Mono', monospace;
    
    --shadow-brutal: 8px 8px 0 rgba(0, 0, 0, 0.6);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.3);
}

/* Light Theme */
[data-theme="light"] {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-surface-light: #f0f0f0;
    --color-primary: #ff6b35;
    --color-primary-dark: #E5512A;
    --color-text: #1a1a1a;
    --color-text-dim: #5a5a5a;
    --color-border: #e0e0e0;
    --color-success: #00b386;
    --color-warning: #f39c12;
    
    --shadow-brutal: 6px 6px 0 rgba(0, 0, 0, 0.12);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(255, 107, 53, 0.15);
}

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

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Noise overlay for texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.title {
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 0.9;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.title-main {
    color: var(--color-text);
    text-shadow: 4px 4px 0 var(--color-primary);
    animation: slideInLeft 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.title-sub {
    color: var(--color-primary);
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
    margin-left: 2rem;
    animation: slideInLeft 0.8s 0.2s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.tagline {
    font-size: 1rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    animation: fadeIn 1s 0.5s backwards;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    padding: 4rem 0;
    border-bottom: 3px solid var(--color-primary);
    margin-bottom: 4rem;
    animation: slideDown 0.6s ease-out;
}

/* Form Styles */
.form-card {
    background: var(--color-surface);
    border: 3px solid var(--color-border);
    padding: 3rem;
    box-shadow: var(--shadow-brutal);
    margin: 2rem 0;
    animation: fadeInUp 0.6s 0.3s backwards;
}

.form-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--color-primary);
    border-left: 6px solid var(--color-primary);
    padding-left: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    color: var(--color-text-dim);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 1rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

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

/* Story Inputs */
.story-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.story-input .story-title {
    flex: 1;
}

.btn-remove {
    background: var(--color-border);
    border: none;
    color: var(--color-text);
    width: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #d73a3a;
    transform: scale(1.1);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    font-family: var(--font-display);
    padding: 1rem 2rem;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    font-weight: bold;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-bg);
    box-shadow: var(--shadow-brutal);
}

.btn-primary:hover {
    transform: translate(4px, 4px);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

.btn-primary:active {
    transform: translate(8px, 8px);
    box-shadow: none;
}

.btn-secondary {
    background: var(--color-surface-light);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
    border-color: var(--color-text-dim);
}

.btn-create {
    width: 100%;
    margin-top: 1rem;
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

/* Poker Cards */
.voting-cards {
    margin: 3rem 0;
}

.card-deck {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    perspective: 1000px;
}

.poker-card {
    width: 80px;
    height: 120px;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    border: 3px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: #333;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.poker-card:hover {
    transform: translateY(-20px) rotateX(15deg) rotateZ(-5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.poker-card:active,
.poker-card.selected {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    transform: scale(1.1) translateY(-10px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
}

.poker-card.card-special {
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    color: var(--color-primary);
}

.card-value {
    position: relative;
    z-index: 1;
}

/* Session Page Layout */
.session-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.session-header {
    background: var(--color-surface);
    border-bottom: 3px solid var(--color-primary);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 1rem;
}

.session-title {
    font-size: 2rem;
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-invite,
.btn-report {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.session-main {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    flex: 1;
}

/* Participants Panel */
.participants-panel {
    background: var(--color-surface);
    border-right: 3px solid var(--color-border);
    padding: 2rem 1rem;
}

.panel-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.participant-item {
    background: var(--color-bg);
    padding: 0.75rem;
    border-left: 3px solid transparent;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.participant-item.voted {
    border-left-color: var(--color-success);
}

.participant-item.host {
    border-left-color: var(--color-primary);
    font-weight: 700;
}

/* Voting Area */
.voting-area {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
}

.current-story {
    background: var(--color-surface);
    border: 3px solid var(--color-border);
    padding: 2rem;
    box-shadow: var(--shadow-brutal);
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.story-title {
    font-size: 1.75rem;
    color: var(--color-text);
}

.story-status {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.story-status.all-voted {
    border-color: var(--color-success);
    color: var(--color-success);
}

.story-description {
    color: var(--color-text-dim);
    margin-bottom: 2rem;
}

/* Votes Display */
.votes-display {
    background: var(--color-bg);
    padding: 2rem;
    border: 3px solid var(--color-primary);
    margin: 2rem 0;
}

.vote-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.vote-item:last-child {
    border-bottom: none;
}

.vote-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Host Controls */
.host-controls {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.confirm-points {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#finalPointsInput {
    width: 150px;
}

/* Stories Panel */
.stories-panel {
    background: var(--color-bg);
    padding: 2rem;
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.story-item {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.story-item:hover {
    border-color: var(--color-primary);
    transform: translateX(5px);
}

.story-item.active {
    border-color: var(--color-primary);
    border-width: 3px;
    box-shadow: var(--shadow-glow);
}

.story-item.completed {
    opacity: 0.6;
}

.story-item-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.story-item-points {
    font-size: 0.875rem;
    color: var(--color-text-dim);
}

.story-item-points.has-points {
    color: var(--color-success);
    font-weight: 700;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--color-surface);
    border: 3px solid var(--color-primary);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-brutal);
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Link Box */
.link-box {
    margin: 1.5rem 0;
}

.link-row {
    display: flex;
    gap: 0.5rem;
}

.link-row input {
    flex: 1;
}

.btn-copy {
    padding: 1rem 1.5rem;
    background: var(--color-primary);
    border: none;
    color: var(--color-bg);
    font-family: var(--font-display);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--color-primary-dark);
}

/* Info Footer */
.info-footer {
    margin: 4rem 0 2rem;
}

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

.info-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.info-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-5px);
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-primary);
}

.info-card p {
    color: var(--color-text-dim);
    font-size: 0.875rem;
}

/* Success Message */
.session-created {
    animation: fadeInUp 0.5s;
}

.session-created h3 {
    color: var(--color-success);
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Error Message */
.error-message {
    background: #d73a3a;
    color: white;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid #a02020;
}

/* Join Page Specific */
.join-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.join-card {
    max-width: 500px;
    width: 100%;
}

.join-title {
    font-size: 4rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
    }
    to {
        transform: translateY(0);
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    padding: 0;
    flex-shrink: 0;
    margin-left: auto;
}

.theme-toggle:hover {
    background: var(--color-border);
    border-color: var(--color-text-dim);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Adjust noise overlay for light theme */
[data-theme="light"] .noise-overlay {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .session-header {
        padding: 1rem;
    }
    
    .session-title {
        font-size: 1.5rem;
        flex-basis: 100%;
    }
    
    .header-actions {
        flex: 1;
        min-width: 0;
    }
    
    .btn-invite,
    .btn-report {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .session-main {
        grid-template-columns: 1fr;
    }
    
    .participants-panel {
        border-right: none;
        border-bottom: 3px solid var(--color-border);
    }
    
    .card-deck {
        gap: 0.5rem;
    }
    
    .poker-card {
        width: 60px;
        height: 90px;
        font-size: 1.75rem;
    }
    
    .title {
        font-size: clamp(2rem, 15vw, 4rem);
    }
}
