/* Neue Montreal Font - Uncomment and add font files to assets/fonts/ when available */
/* 
@font-face {
    font-family: 'Neue Montreal';
    src: url('assets/fonts/NeueMontreal-Regular.woff2') format('woff2'),
         url('assets/fonts/NeueMontreal-Regular.woff') format('woff'),
         url('assets/fonts/NeueMontreal-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Neue Montreal';
    src: url('assets/fonts/NeueMontreal-Medium.woff2') format('woff2'),
         url('assets/fonts/NeueMontreal-Medium.woff') format('woff'),
         url('assets/fonts/NeueMontreal-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Neue Montreal';
    src: url('assets/fonts/NeueMontreal-Bold.woff2') format('woff2'),
         url('assets/fonts/NeueMontreal-Bold.woff') format('woff'),
         url('assets/fonts/NeueMontreal-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: transparent;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Still Background (shown while video loads) */
.bg-still {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/bg_still.jpg'), url('assets/bg_still.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.bg-still.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Video Background */
#bgVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#bgVideo.loaded {
    opacity: 1;
}

/* Fallback background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -3;
    opacity: 0;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.002);
    backdrop-filter: blur(3px) saturate(105%);
    -webkit-backdrop-filter: blur(3px) saturate(105%);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Liquid glass morphism effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.001) 0%,
        rgba(255, 255, 255, 0.0005) 50%,
        rgba(255, 255, 255, 0.001) 100%
    );
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.001) 90deg,
        transparent 180deg,
        rgba(255, 255, 255, 0.0005) 270deg,
        transparent 360deg
    );
    animation: rotate 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ensure content is above the animated background */
.card > * {
    position: relative;
    z-index: 2;
}

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

.header h1 {
    color: #111827;
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.header p {
    color: #000000;
    font-size: 0.875rem;
    line-height: 1.5;
}

.form {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 14px;
    color: #374151;
    font-weight: 400;
}

.input-group input {
    height: 44px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 0 12px;
    font-size: 16px;
    outline: none;
    background: #ffffff;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.input-group input:focus {
    border-color: #3b82f6;
}

.input-group input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn {
    height: 44px;
    border-radius: 10px;
    border: none;
    color: #ffffff;
    background-color: #111827;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, cursor 0.2s ease;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
    background-color: #1f2937;
}

.submit-btn:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-loader::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    min-height: 20px;
    font-size: 14px;
    color: #e74c3c;
    text-align: center;
    margin-top: 4px;
}

.success-message {
    min-height: 20px;
    font-size: 14px;
    color: #2ecc71;
    text-align: center;
    margin-top: 4px;
}

.claimed-message {
    min-height: 20px;
    font-size: 14px;
    color: #e67e22;
    text-align: center;
    margin-top: 4px;
}

.back-link {
    text-align: center;
    margin-top: 20px;
}

.back-link a {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link a:hover {
    color: #374151;
    text-decoration: underline;
}

/* Status-based input styling */
.input-group input.error {
    border-color: #e74c3c;
}

.input-group input.claimed {
    border-color: #e67e22;
}

.input-group input.success {
    border-color: #2ecc71;
}

/* Countdown Styles */
.countdown {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: auto;
    min-width: 280px;
    min-height: 80px;
    background: rgba(233, 188, 187, 0.15);
    backdrop-filter: blur(3px) saturate(105%);
    -webkit-backdrop-filter: blur(3px) saturate(105%);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: rotate(-1deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Neue Montreal', sans-serif;
    cursor: move;
    visibility: visible;
    opacity: 1;
    color: #000000;
}

.countdown.dragging {
    cursor: grabbing;
    transform: rotate(0deg);
    transition: none;
}

.countdown:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.6),
        0 12px 24px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.countdown-display {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.split-flap-container {
    display: flex;
    gap: 2px;
}

.split-flap {
    position: relative;
    width: 40px;
    height: 56px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    perspective: 200px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-flap::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 2;
    pointer-events: none;
}

.flap-top,
.flap-bottom {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.9);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: center;
    transition: transform 0.3s ease;
    line-height: 1;
    padding: 0;
    box-sizing: border-box;
}

.flap-top {
    top: 0;
    align-items: center;
    padding: 0;
    transform-origin: bottom;
    z-index: 3;
    height: 100%;
}

.flap-bottom {
    bottom: 0;
    align-items: center;
    padding: 0;
    transform-origin: top;
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    height: 100%;
    background: transparent;
}

.split-flap.flipping .flap-bottom {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.9);
}

.split-flap.flipping .flap-top {
    animation: flipTop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-flap.flipping .flap-bottom {
    animation: flipBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes flipTop {
    0% {
        transform: rotateX(0deg);
        z-index: 1;
    }
    50% {
        transform: rotateX(-90deg);
        z-index: 0;
    }
    100% {
        transform: rotateX(0deg);
        z-index: 1;
    }
}

@keyframes flipBottom {
    0% {
        transform: rotateX(0deg);
        z-index: 0;
    }
    50% {
        transform: rotateX(90deg);
        z-index: 1;
    }
    100% {
        transform: rotateX(0deg);
        z-index: 0;
    }
}

.unit-label {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    opacity: 0.7;
    margin-top: 2px;
}

/* TV Gadget Styles */
.tv-gadget {
    display: none !important;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 320px;
    background: #000000;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    flex-direction: column;
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Neue Montreal', sans-serif;
    cursor: move;
    transform: rotate(-1deg);
    visibility: visible;
    opacity: 1;
}

.tv-gadget.dragging {
    cursor: grabbing;
    transform: rotate(0deg);
    transition: none;
}

.tv-gadget:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.6),
        0 12px 24px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.tv-screen {
    position: relative;
    width: 100%;
    background: #0a0a0a;
    overflow: hidden;
    cursor: pointer;
}

.tv-screen video {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    border-radius: 8px;
}

/* Pong Game Styles */
.pong-game {
    display: none !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 264px;
    background: #000000;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.5),
        0 8px 16px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(1deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    flex-direction: column;
    padding: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Neue Montreal', sans-serif;
    cursor: move;
    visibility: visible;
    opacity: 1;
}

.pong-game.dragging {
    cursor: grabbing;
    transform: rotate(0deg);
    transition: none;
}

.pong-game:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.6),
        0 12px 24px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

.pong-game-header {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.pong-score {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

#pongCanvas {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: #0a0a0a;
    display: block;
    margin: 0 auto;
    cursor: default;
}

.pong-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.pong-instructions {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.pong-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #ffffff;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.pong-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.pong-game-header,
.pong-controls {
    pointer-events: auto;
}

/* Sticky Note Styles */
.sticky-note {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    height: 320px;
    background: rgba(233, 188, 187, 0.15);
    backdrop-filter: blur(3px) saturate(105%);
    -webkit-backdrop-filter: blur(3px) saturate(105%);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: rotate(-2deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    cursor: move;
    color: #000000;
}

.sticky-note.dragging {
    cursor: grabbing;
    transform: rotate(0deg);
    transition: none;
}

.sticky-note:hover:not(.fullscreen) {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.6),
        0 12px 24px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* Fullscreen mode - fills current viewport */
.sticky-note.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    transform: rotate(0deg);
    border-radius: 0;
    z-index: 9999;
    cursor: default;
    margin: 0;
    padding: 0;
}

.sticky-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move;
}

.sticky-note-title {
    color: #000000;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.sticky-note.fullscreen .sticky-note-header {
    cursor: default;
}

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    color: #000000;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

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

.sticky-note-content {
    flex: 1;
    padding: 16px;
    overflow: hidden;
    display: flex;
    min-height: 0;
}

.sticky-note-content textarea {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: #000000;
    padding: 0;
    pointer-events: auto;
    cursor: default;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.sticky-note-content textarea::-webkit-scrollbar {
    width: 6px;
}

.sticky-note-content textarea::-webkit-scrollbar-track {
    background: transparent;
}

.sticky-note-content textarea::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sticky-note-content textarea::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.sticky-note-content textarea[readonly] {
    cursor: default;
    user-select: text;
}

.sticky-note-content textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Sticky note tape effect */
.sticky-note::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 480px) {
    .card {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .sticky-note {
        width: 240px;
        height: 280px;
        top: 10px;
        right: 10px;
    }
    
    .sticky-note.fullscreen {
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
    }
}

/* Animation for page transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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