/* ============================================
   GLOBAL STYLES & RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */
.nav-tabs {
    display: flex;
    background: var(--white);
    border-bottom: 2px solid var(--light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 16px 8px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn:hover {
    background: var(--light);
}

.info-red {
    color: red;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
    height: 100%;
}

.tab-pane.active {
    display: block;
}

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

/* ============================================
   HOME TAB
   ============================================ */
.home-container {
    padding: 24px;
    text-align: center;
}

.logo h1 {
    font-size: 32px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--gray);
    font-size: 16px;
    margin-bottom: 32px;
}

.status-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
}

.status-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    font-size: 18px;
}

.status-icon {
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: scale(0.98);
}

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

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

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

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

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

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

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

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-end-expose {
    background: linear-gradient(135deg, #ff3838, #ff6b6b);
    color: white;
    font-weight: bold;
    border: 2px solid #ff1a1a;
    animation: end-expose-pulse 1.5s infinite;
    box-shadow: 0 4px 15px rgba(255, 56, 56, 0.4);
}

.btn-end-expose:hover {
    background: linear-gradient(135deg, #ff1a1a, #ff3838);
    box-shadow: 0 6px 20px rgba(255, 56, 56, 0.6);
    transform: translateY(-2px);
}

@keyframes end-expose-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 56, 56, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(255, 56, 56, 0.7);
    }
}

.btn-icon {
    padding: 12px;
    font-size: 20px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   CHAT TAB
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    position: relative;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light);
    border-bottom: 1px solid var(--gray);
    position: sticky;
    top: 0;
    z-index: 95;
    flex: 0 0 auto;
}

.partner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-pill {
    background: var(--primary);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: var(--shadow);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray);
}

.status-dot.online {
    background: var(--success);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.messages-container {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: linear-gradient(to bottom, #f9fafb, #ffffff);
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.message {
    margin-bottom: 16px;
    display: flex;
    animation: slideIn 0.3s ease;
}

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

.message.sent {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius);
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: var(--light);
    color: var(--dark);
    border-bottom-left-radius: 4px;
}

.message.system .message-bubble {
    background: var(--warning);
    color: var(--white);
    margin: 0 auto;
    font-size: 14px;
}

.message-media {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.message-media:hover {
    transform: scale(1.05);
}

video.message-media {
    display: block;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: var(--white);
    border-top: 1px solid var(--light);
    position: sticky;
    bottom: 0;
    z-index: 95;
    flex: 0 0 auto;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
}

#message-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ============================================
   EXPOSED TAB
   ============================================ */
.exposed-container {
    padding: 24px;
}

.exposed-header {
    text-align: center;
    margin-bottom: 24px;
}

.exposed-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.exposed-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.exposed-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

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

.exposed-item img,
.exposed-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.exposed-item .timer {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Image Stack Styling */
.exposed-item.image-stack {
    position: relative;
}

.exposed-item.image-stack::before,
.exposed-item.image-stack::after {
    content: '';
    position: absolute;
    width: 95%;
    height: 100%;
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: -1;
}

.exposed-item.image-stack::before {
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
}

.exposed-item.image-stack::after {
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(1deg);
}

.stack-count-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.view-count-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nickname-badge {
    position: absolute;
    bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray);
    font-size: 18px;
}

/* ============================================
   FLOATING POINTS
   ============================================ */
.floating-points {
    position: fixed;
    top: 70px;
    right: 16px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 90;
    min-width: 150px;
}

.points-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.points-item:last-child {
    margin-bottom: 0;
}

.points-value {
    color: var(--primary);
    font-size: 18px;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--danger);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    transform: rotate(90deg);
}

/* ============================================
   CAMERA MODAL
   ============================================ */
.camera-modal-content {
    max-width: 500px;
    width: 90%;
}

.camera-container {
    width: 100%;
    margin: 16px 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--dark);
    position: relative;
}

#camera-video,
#camera-preview,
#camera-preview-video {
    width: 100%;
    display: block;
}

.camera-countdown {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.countdown-number {
    font-size: 120px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: countdown-pulse 1s ease-in-out;
}

@keyframes countdown-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.camera-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--radius);
}

.camera-settings label {
    font-weight: 600;
    color: var(--text);
}

.camera-settings select {
    padding: 6px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.camera-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.gif-progress {
    text-align: center;
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0;
    transition: width 0.1s linear;
    animation: progress 4.9s linear;
}

@keyframes progress {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* ============================================
   GAME MODALS
   ============================================ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.game-card {
    background: var(--light);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.game-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.game-card h3 {
    margin-bottom: 8px;
}

.game-card p {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 12px;
}

.game-settings {
    margin-top: 24px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius);
}

.setting-item {
    margin-bottom: 12px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dare-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.dare-categories label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.setting-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

/* Dice Game */
.dice-game-container {
    text-align: center;
}

.dice-area {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 24px 0;
}

.player-dice {
    text-align: center;
}

.dice {
    width: 80px;
    height: 80px;
    background: var(--white);
    border: 3px solid var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    margin: 16px auto;
    box-shadow: var(--shadow);
    animation: diceRoll 0.5s ease;
}

@keyframes diceRoll {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

.vs-divider {
    font-size: 24px;
    font-weight: bold;
    color: var(--gray);
}

.dice-result {
    margin-top: 24px;
    font-size: 20px;
    font-weight: bold;
}

.dare-display {
    background: var(--secondary);
    color: var(--white);
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
    font-size: 16px;
}

/* Tic-Tac-Toe */
.tictactoe-container {
    text-align: center;
    padding: 16px;
}

.turn-indicator {
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 300px;
    margin: 0 auto 24px;
}

.tictactoe-cell {
    aspect-ratio: 1;
    background: var(--light);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tictactoe-cell:hover:not(.taken) {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

.tictactoe-cell.taken {
    cursor: not-allowed;
}

.game-result {
    font-size: 20px;
    font-weight: bold;
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
}

.game-result.win {
    background: var(--success);
    color: var(--white);
}

.game-result.lose {
    background: var(--danger);
    color: var(--white);
}

.game-result.tie {
    background: var(--warning);
    color: var(--white);
}

/* ============================================
   EXPOSE MODAL
   ============================================ */
.game-summary {
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.expose-section {
    margin-top: 24px;
}

.media-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.media-item {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 3px solid transparent;
    transition: var(--transition);
}

.media-item.selected {
    border-color: var(--primary);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.expose-duration {
    margin: 16px 0;
}

.expose-duration label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.expose-duration select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 16px;
}

.expose-nickname-option {
    margin: 16px 0;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.expose-nickname-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.expose-nickname-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.expose-nickname-option span {
    font-weight: 600;
    color: var(--primary);
}

/* ============================================
   LOADING & TOAST
   ============================================ */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: var(--white);
    margin-top: 16px;
    font-size: 18px;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.toast {
    background: var(--dark);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 600px) {
    #app {
        max-width: 100%;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95%;
        padding: 16px;
    }

    .home-container {
        padding: 16px;
    }

    .logo h1 {
        font-size: 24px;
    }

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

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

    .floating-points {
        top: 120px;
        left: 8px;
        right: auto;
        font-size: 12px;
        min-width: 120px;
        padding: 8px 12px;
    }

    .dice-area {
        flex-direction: column;
        gap: 24px;
    }

    .vs-divider {
        transform: rotate(90deg);
    }

    /* Chat fixes for mobile */
    .tab-content {
        overflow-y: hidden; /* Prevent double scrolling on mobile */
    }

    #chat-tab {
        height: 100%;
        overflow: hidden;
    }

    .chat-container {
        height: 100%;
        max-height: 100%;
        position: relative;
    }

    .chat-header {
        position: fixed;
        top: 60px; /* Below nav tabs */
        left: 0;
        right: 0;
        max-width: 600px;
        margin: 0 auto;
        padding: 12px;
        z-index: 95;
    }

    .messages-container {
        padding: 12px;
        padding-top: 70px; /* Space for fixed header */
        padding-bottom: 80px; /* Space for fixed input */
        height: calc(100vh - 60px); /* Full height minus nav tabs */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 600px;
        margin: 0 auto;
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        z-index: 95;
    }

    #message-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .message-bubble {
        max-width: 85%;
    }
}

/* ============================================
   IMAGE MODAL
   ============================================ */
.image-modal-content {
    padding: 0;
    background: transparent;
    max-width: 95%;
    max-height: 95%;
}

#modal-image,
#modal-video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius);
}

/* ============================================
   SESSION GALLERY MODAL
   ============================================ */
.session-gallery-content {
    max-width: 90%;
    max-height: 90vh;
    background: var(--white);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--dark);
}

.gallery-counter {
    font-size: 14px;
    color: var(--gray);
    font-weight: 500;
}

.gallery-media-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg);
    overflow: hidden;
}

.gallery-media-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    max-height: 100%;
}

#gallery-image,
#gallery-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

/* ============================================
   CONTRIBUTE DARES MODAL
   ============================================ */
.contribute-form {
    padding: 20px 0;
}

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

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
}

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

.char-count {
    display: block;
    text-align: right;
    color: var(--gray);
    font-size: 12px;
    margin-top: 4px;
}

.success-message {
    padding: 20px;
    text-align: center;
    background: var(--success);
    color: var(--white);
    border-radius: var(--radius);
    margin: 20px 0;
}

.success-message p {
    font-size: 16px;
    font-weight: 600;
}

#imprint-link {
    color: lightgrey;
}

/* ============================================
   IMPRINT MODAL
   ============================================ */
.imprint-content {
    padding: 20px 0;
    line-height: 1.8;
}

.imprint-content p {
    margin-bottom: 10px;
}

/* ============================================
   CONSENT MODAL
   ============================================ */
.modal-blocking {
    z-index: 9999;
}

.consent-modal-content {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.consent-text {
    padding: 20px 0;
    line-height: 1.6;
}

.consent-text h3 {
    color: var(--primary);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.consent-text p {
    margin-bottom: 15px;
    color: var(--dark-light);
}

.consent-text ul {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.consent-text ul li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
}

.consent-text ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

.consent-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-direction: column;
}

.consent-actions .btn {
    margin: 0;
}

/* ============================================
   FOOTER LINKS
   ============================================ */
.footer-links {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--light);
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   FAQ MODAL STYLES
   ============================================ */
.faq-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.faq-container {
    margin-top: 20px;
}

.faq-item {
    border: 1px solid var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--light);
    cursor: pointer;
    font-weight: 600;
    color: var(--dark);
    transition: var(--transition);
}

.faq-question:hover {
    background: #e5e7eb;
}

.faq-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: var(--white);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 16px 20px;
}

.faq-answer p {
    margin: 0;
    color: var(--gray);
    line-height: 1.6;
}

/* ============================================
   PLAYDATE MODE STYLES
   ============================================ */
.playdate-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius);
    position: relative;
}

.toggle-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 16px;
}

.new-badge {
    position: relative;
    display: inline-block;
    padding: 4px 8px;
    background: linear-gradient(135deg, #90ff6b 0%, #43af4b 100%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(238, 90, 111, 0.3);
    animation: badge-pulse 2s ease-in-out infinite;
}

.experimental-badge {
    position: relative;
    display: inline-block;
    padding: 4px 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    margin-left: 8px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(117, 238, 90, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 8px rgba(110, 238, 90, 0.5);
    }
}

.new-badge:hover {
    background: linear-gradient(135deg, #7aee5a 0%, #43af4b 100%);
}

.badge-flyout {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 12px 16px;
    background: white;
    color: black;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    z-index: 1000;
    text-align: left;
}

.badge-flyout::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

.badge-flyout::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-top-color: var(--border);
    margin-top: 1px;
}

.new-badge:hover .badge-flyout {
    display: block;
    animation: flyout-appear 0.2s ease-out;
}

@keyframes flyout-appear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary);
}

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

/* Session ID Display Card */
.session-id-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 0 20px 20px 20px;
    box-shadow: var(--shadow);
}

/* Nickname Container */
.nickname-container {
    margin: 20px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius);
}

.nickname-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.nickname-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: var(--transition);
}

.nickname-input:focus {
    outline: none;
    border-color: var(--primary);
}

.nickname-input.error {
    border-color: var(--danger);
}

.nickname-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray);
}

.nickname-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--danger);
    font-weight: 600;
}

.session-id-label {
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
}

.session-id-value {
    flex: 1;
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-align: center;
}

#copy-session-id-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}

#copy-session-id-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Join Playdate Form */
.join-playdate-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.join-playdate-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 16px;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: var(--transition);
}

.join-playdate-form .form-control:focus {
    border-color: var(--primary);
    outline: none;
}

/* ============================================
   ROCK PAPER SCISSORS GAME STYLES
   ============================================ */
.rps-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rps-scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius);
}

.rps-scoreboard .score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rps-scoreboard .score-label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
}

.rps-scoreboard .score-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.rps-scoreboard .round-counter {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
}

.rps-choices-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: var(--radius);
}

.choice-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.choice-display p {
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
    margin: 0;
}

.choice-emoji {
    font-size: 64px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.vs-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.rps-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rps-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: white;
    border: 3px solid var(--light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    min-width: 100px;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.rps-choice-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.rps-choice-btn.selected {
    border-color: var(--success);
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.rps-choice-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.choice-emoji-large {
    font-size: 48px;
}

.rps-round-result {
    text-align: center;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    animation: slideUp 0.3s ease;
}

.rps-round-result.win {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: var(--success);
}

.rps-round-result.lose {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: var(--danger);
}

.rps-round-result.tie {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: var(--warning);
}

.rps-round-result.final {
    font-size: 24px;
    padding: 24px;
    border: 3px solid currentColor;
}

/* ============================================
   LUCKY NUMBER DUEL GAME STYLES
   ============================================ */
.luckynum-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.luckynum-scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius);
}

.luckynum-scoreboard .score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.luckynum-scoreboard .score-label {
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
}

.luckynum-scoreboard .score-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.luckynum-scoreboard .round-counter {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
}

.game-instruction {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius);
}

.luckynum-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: var(--radius);
}

.number-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.number-display.target {
    flex: 1.5;
}

.number-display p {
    font-size: 13px;
    color: var(--gray);
    font-weight: 600;
    margin: 0;
}

.number-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.number-value.big {
    font-size: 64px;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.reveal-animation {
    animation: pulse 1s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.luckynum-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.luckynum-btn {
    padding: 16px;
    font-size: 24px;
    font-weight: 700;
    background: white;
    border: 3px solid var(--light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--dark);
}

.luckynum-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
}

.luckynum-btn.selected {
    border-color: var(--success);
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: var(--success);
}

.luckynum-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.luckynum-result {
    text-align: center;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    animation: slideUp 0.3s ease;
}

.luckynum-result.win {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: var(--success);
}

.luckynum-result.lose {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: var(--danger);
}

.luckynum-result.tie {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: var(--warning);
}

.luckynum-result.final {
    font-size: 20px;
    padding: 20px;
    border: 3px solid currentColor;
}

/* ============================================
   WINNER CHOOSES EXPOSURE FEATURE
   ============================================ */

/* Highlighted setting item */
.setting-item-highlight {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    padding: 16px;
    border-radius: var(--radius);
    border: 2px solid var(--danger);
    margin: 12px 0;
}

.setting-label-warning {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.setting-label-warning input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-label-warning .setting-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-label-warning .setting-text strong {
    font-size: 16px;
    color: var(--danger);
}

.setting-label-warning .setting-text small {
    font-size: 13px;
    color: #666;
    font-weight: normal;
}

/* Warning modal */
.warning-modal-content {
    max-width: 500px;
    padding: 32px;
}

.warning-modal-content h2 {
    color: var(--danger);
    margin-bottom: 24px;
    font-size: 24px;
    text-align: center;
}

.warning-text {
    margin-bottom: 24px;
    line-height: 1.6;
}

.warning-text p {
    margin: 12px 0;
}

.warning-highlight {
    background: #fef3c7;
    padding: 16px;
    border-left: 4px solid var(--warning);
    border-radius: 4px;
    margin: 20px 0;
}

.warning-highlight p {
    margin: 8px 0;
}

.warning-highlight strong {
    color: var(--warning);
}

.warning-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: bold;
}

/* Winner exposure selection modal */
.exposure-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.exposure-pic-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.exposure-pic-item:hover {
    transform: scale(1.05);
}

.exposure-pic-item img,
.exposure-pic-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.exposure-pic-item.selected {
    border: 4px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-light);
}

.exposure-pic-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.exposure-selection-info {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.exposure-selection-info p {
    margin: 8px 0;
    line-height: 1.5;
}

.exposure-selection-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Liar's Dice Game */
.liars-dice-container {
    display: flex;
    flex-direction: column;
    padding: 12px;
    max-width: 650px;
    margin: 0 auto;
    gap: 12px;
    height: 100%;
    position: relative;
}

/* Partner's Dice Section (Top) */
.partner-dice-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 10px;
    border: 2px solid var(--border);
}

.partner-dice-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.section-header h3 {
    font-size: 14px;
    margin: 0;
    color: var(--text-secondary);
}

.dice-count-badge {
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
}

.partner-dice {
    min-height: 50px;
}

.die-back {
    font-size: 44px;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: bold;
    animation: mysterySpin 3s infinite ease-in-out;
}

@keyframes mysterySpin {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(10deg);
    }
}

/* Middle Section: Game Controls */
.game-controls-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 0;
}

/* My Dice Section (Bottom) */
.my-dice-section-new {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 10px;
    border: 2px solid var(--primary);
}

.my-dice-section-new .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Overlay Indicators */
.overlay-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay-indicator.show {
    opacity: 1;
}

.overlay-emote {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.overlay-emote.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.dice-hand {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    min-height: 60px;
}

.die {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                inset 0 2px 4px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid rgba(0, 0, 0, 0.05);
}

.die.rolling {
    animation: rollDice 0.6s ease-out, dicePulse 0.6s ease-out;
}

@keyframes rollDice {
    0% {
        transform: rotate(0deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 1;
    }
}

@keyframes dicePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
                    0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

.die:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.current-bet-compact {
    text-align: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    font-size: 24px;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

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

.current-bet-compact strong {
    margin-right: 8px;
}

.current-bet-compact em {
    font-style: normal;
    opacity: 0.9;
}

/* Floating Emote Buttons */
.emote-section-floating {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 100;
}

.emote-btn-small {
    width: 36px;
    height: 36px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.emote-btn-small:hover:not(:disabled) {
    background: var(--primary);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.emote-btn-small:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Compact Betting Controls */
.bet-controls-compact {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.bet-dice-selector {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bet-die {
    font-size: 36px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: 3px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.bet-die:hover:not(.disabled) {
    transform: scale(1.15) translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bet-die.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.6);
    animation: betDiceSelected 0.3s ease-out;
}

@keyframes betDiceSelected {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.15) translateY(-4px);
    }
    100% {
        transform: scale(1.08) translateY(-2px);
    }
}

.bet-die.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.8);
}

.bet-count-control-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.count-label-small {
    font-weight: bold;
    font-size: 16px;
    color: var(--text-secondary);
}

.btn-control-small {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-control-small:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.btn-control-small:active {
    transform: scale(0.95);
}

.bet-count-control-compact input {
    width: 60px;
    padding: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

/* Action Buttons Row */
.action-buttons-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.action-buttons-row .btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-buttons-row .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-buttons-row .btn:active::before {
    width: 300px;
    height: 300px;
}

.action-buttons-row .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-buttons-row .btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.action-buttons-row .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.action-buttons-row .btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.action-buttons-row .btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.action-buttons-row .btn-danger:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.5);
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateY(-3px) scale(1.02) rotate(0deg); }
    25% { transform: translateY(-3px) scale(1.02) rotate(-2deg); }
    75% { transform: translateY(-3px) scale(1.02) rotate(2deg); }
}

.bet-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin: 20px 0;
}

.bet-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bet-input-group label {
    font-weight: bold;
    min-width: 100px;
}

.number-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-control {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-control:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.btn-control:active {
    transform: scale(0.95);
}

.number-control input {
    width: 80px;
    padding: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

#call-liar-btn {
    margin: 20px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.reveal-section {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    text-align: center;
}

.reveal-section h3 {
    margin-bottom: 15px;
    font-size: 24px;
}

.all-dice {
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: var(--radius);
}

.all-dice div {
    margin: 10px 0;
    font-size: 16px;
}

.win-text {
    color: var(--success);
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0;
}

.lose-text {
    color: var(--danger);
    font-size: 20px;
    font-weight: bold;
    margin: 15px 0;
}

.game-end-section {
    padding: 30px;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.game-end-section h2 {
    font-size: 28px;
    margin-bottom: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .liars-dice-container {
        padding: 8px;
        gap: 10px;
    }

    .dice-hand {
        gap: 6px;
        padding: 8px;
    }

    .die {
        font-size: 38px;
        width: 54px;
        height: 54px;
    }

    .die-back {
        font-size: 36px;
        width: 50px;
        height: 50px;
    }

    .bet-die {
        font-size: 30px;
        width: 46px;
        height: 46px;
    }

    .partner-dice-section,
    .my-dice-section-new {
        padding: 8px;
    }

    .game-controls-section {
        padding: 0;
        gap: 8px;
    }

    .section-header h3 {
        font-size: 13px;
    }

    .dice-count-badge {
        font-size: 13px;
        padding: 2px 8px;
    }

    .current-bet-compact {
        font-size: 17px;
        padding: 10px 14px;
        min-height: 44px;
    }

    .emote-btn-small {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .emote-section-floating {
        right: 5px;
        gap: 4px;
    }

    .action-buttons-row .btn {
        padding: 12px 18px;
        font-size: 16px;
    }

    .overlay-indicator {
        font-size: 18px;
        padding: 12px 24px;
    }

    .overlay-emote {
        font-size: 50px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
