/* Web Photobooth - Matches OpenCV Version Exactly */

@font-face {
    font-family: 'PhotoboothFont';
    src: url('/content/font/font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* NEW: Galter font */
@font-face {
    font-family: 'Galter';
    src: url('/content/font/galter.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root{
  /* used only if a screen has no own background */
  --preview-fallback-bg: radial-gradient(120% 120% at 50% 0%, #3a1e2c 0%, #261b3c 45%, #142e3a 100%);
}

body {
    font-family: 'PhotoboothFont', 'Arial', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    /* cursor managed by JavaScript auto-hide */
}
.hidden {
    display: none !important;
}

/* Settings Button */
.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: rgba(138, 61, 212, 0.8);
    border: 2px solid #f73;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(255, 119, 51, 0.5);
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.settings-button:hover {
    background: rgba(138, 61, 212, 1);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 119, 51, 0.8);
}

/* QR/Your Photos Button */
.qr-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 998;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: rgba(138, 61, 212, 0.8);
    border: 2px solid #f73;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(255, 119, 51, 0.5);
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.qr-button:hover {
    background: rgba(138, 61, 212, 1);
    box-shadow: 0 0 30px rgba(255, 119, 51, 0.8);
}

/* Strip Format Button */
.strip-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 998;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: rgba(138, 61, 212, 0.8);
    border: 2px solid #f73;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px rgba(255, 119, 51, 0.5);
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.strip-button:hover {
    background: rgba(138, 61, 212, 1);
    box-shadow: 0 0 30px rgba(255, 119, 51, 0.8);
}

/* Screen containers */
.screen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-container.hidden {
    display: none;
}

/* Idle/Home Screen - EXACT match to OpenCV */
#idle-screen {
    background: url('/content/wallpaper/splash.png') center center no-repeat;
    background-size: cover;
    position: relative;
    animation: none;
}

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

.idle-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.idle-content > * {
    pointer-events: auto;
}

/* Splash image display */
.splash-display {
    display: none; /* Hidden - using as background instead */
}
.calibrated-frame {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 12px solid rgba(245,113,138,.8);
  border-radius: 30px;
  box-shadow:
    0 0 30px rgba(245,113,138,.6),
    0 0 60px rgba(245,113,138,.4),
    inset 0 0 40px rgba(255,255,255,.1);
  animation: frame-pulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 11;                 /* above canvas, below CTA */
  transform-origin: center center;
  transform: var(--pb-cal, none);  /* <-- follows calibration */
}

/* Particle canvas overlay */
.particle-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.start-text {
    font-size: 36px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: pulse-text 1.5s ease-in-out infinite;
    font-family: 'PhotoboothFont', Arial, sans-serif;
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    white-space: nowrap;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1.05);
    }
}

/* Preview Screen (camera feed) */
#preview-screen {
    background: linear-gradient(135deg, 
        rgba(245, 113, 138, 0.3) 0%, 
        rgba(138, 61, 212, 0.3) 50%, 
        rgba(104, 172, 163, 0.3) 100%);
    z-index: 10;
}

/* QR Screen */
#qr-screen {
    background: linear-gradient(135deg, 
        rgba(245, 113, 138, 0.3) 0%, 
        rgba(138, 61, 212, 0.3) 50%, 
        rgba(104, 172, 163, 0.3) 100%);
    z-index: 10;
}

/* Calibrated content layer for QR screen */
#qr-content-layer {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    transform: var(--pb-cal, none);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-frame-container {
    width: min(70vh, 70vw);
    height: min(70vh, 70vw);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(255, 152, 184, 0.4),
        inset 0 0 60px rgba(138, 61, 212, 0.2);
    border: 3px solid rgba(255, 152, 184, 0.6);
}

#qr-image {
    max-width: 85%;
    max-height: 85%;
    border-radius: 8px;
}

/* Clickable QR link */
.qr-clickable-link {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.qr-clickable-link:hover {
    transform: scale(1.05);
}

.qr-clickable-link:hover #qr-image {
    filter: brightness(1.1);
}

.qr-clickable-link:active {
    transform: scale(0.98);
}

.qr-hint {
    margin-top: 30px;
    text-align: center;
    font-family: 'Galter', Arial, sans-serif;
}

.qr-hint p {
    font-size: 24px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 119, 51, 0.8);
    margin: 8px 0;
}

.qr-hint .qr-back-hint {
    font-size: 16px;
    opacity: 0.7;
}

/* Strip Selector Screen */
#strip-selector-screen {
    background: linear-gradient(135deg, 
        rgba(245, 113, 138, 0.3) 0%, 
        rgba(138, 61, 212, 0.3) 50%, 
        rgba(104, 172, 163, 0.3) 100%);
    z-index: 10;
}

#strip-selector-content-layer {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    transform: var(--pb-cal, none);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.strip-selector-title {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 56px;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 119, 51, 0.8);
    margin-bottom: 50px;
}

.strip-selector-options {
    display: flex;
    gap: 50px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.strip-selector-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px;
    background: rgba(0, 0, 0, 0.4);
    border: 4px solid rgba(255, 152, 184, 0.4);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 280px;
}

.strip-selector-option:hover,
.strip-selector-option.focused {
    border-color: rgba(255, 152, 184, 0.9);
    box-shadow: 0 0 30px rgba(255, 152, 184, 0.5);
    transform: scale(1.05);
}

.strip-selector-option.selected {
    border-color: #f73;
    box-shadow: 0 0 40px rgba(255, 119, 51, 0.6);
}

.strip-option-preview {
    width: 260px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
}

.strip-option-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.strip-option-label {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 24px;
    color: #fff;
    text-align: center;
}

.strip-selector-hint {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 20px;
    color: #fff;
    opacity: 0.7;
    margin-top: 50px;
}

#photobooth-canvas{
  position:absolute; inset:0;
  width:100%; height:100%;
  display:block; z-index:5;
  transform:none; object-fit:cover;
}

/* Calibrated content layer - follows overscan like idle-anim-layer */
#preview-content-layer {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    transform: var(--pb-cal, none);  /* Follows calibration */
    z-index: 10;
    pointer-events: none;
}

#preview-content-layer > * {
    pointer-events: auto;
}

/* Square pink frame that follows calibration */
/* Neon corner frame like your mockup */
.preview-frame {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 9;
  transform-origin: center center;

  /* no full border */
  border: none;
  border-radius: 0;
  box-shadow: none;

  /* 8 small L-shaped corner segments (outer + inner line) */
  background:
    /* top-left outer */
    linear-gradient(to right, #ff98b8 0 60%, transparent 60%) 0 0 / 80px 4px no-repeat,
    linear-gradient(to bottom, #ff98b8 0 60%, transparent 60%) 0 0 / 4px 80px no-repeat,
    /* top-right outer */
    linear-gradient(to left, #ff98b8 0 60%, transparent 60%) 100% 0 / 80px 4px no-repeat,
    linear-gradient(to bottom, #ff98b8 0 60%, transparent 60%) 100% 0 / 4px 80px no-repeat,
    /* bottom-left outer */
    linear-gradient(to right, #ff98b8 0 60%, transparent 60%) 0 100% / 80px 4px no-repeat,
    linear-gradient(to top,  #ff98b8 0 60%, transparent 60%) 0 100% / 4px 80px no-repeat,
    /* bottom-right outer */
    linear-gradient(to left, #ff98b8 0 60%, transparent 60%) 100% 100% / 80px 4px no-repeat,
    linear-gradient(to top,  #ff98b8 0 60%, transparent 60%) 100% 100% / 4px 80px no-repeat,

    /* inner “second” line, slightly inset */
    linear-gradient(to right, #ffcedf 0 60%, transparent 60%) 12px 12px / 64px 3px no-repeat,
    linear-gradient(to bottom,#ffcedf 0 60%, transparent 60%) 12px 12px / 3px 64px no-repeat,
    linear-gradient(to left,  #ffcedf 0 60%, transparent 60%) calc(100% - 12px) 12px / 64px 3px no-repeat,
    linear-gradient(to bottom,#ffcedf 0 60%, transparent 60%) calc(100% - 12px) 12px / 3px 64px no-repeat,
    linear-gradient(to right, #ffcedf 0 60%, transparent 60%) 12px calc(100% - 12px) / 64px 3px no-repeat,
    linear-gradient(to top,  #ffcedf 0 60%, transparent 60%) 12px calc(100% - 12px) / 3px 64px no-repeat,
    linear-gradient(to left,  #ffcedf 0 60%, transparent 60%) calc(100% - 12px) calc(100% - 12px) / 64px 3px no-repeat,
    linear-gradient(to top,  #ffcedf 0 60%, transparent 60%) calc(100% - 12px) calc(100% - 12px) / 3px 64px no-repeat;

  /* soft glow */
  filter: drop-shadow(0 0 12px rgba(255,152,184,0.9))
          drop-shadow(0 0 28px rgba(255,152,184,0.7));
  animation: frame-corner-pulse 2s ease-in-out infinite;
}




@keyframes frame-corner-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(255,152,184,0.8))
            drop-shadow(0 0 26px rgba(255,152,184,0.55));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(255,180,210,1))
            drop-shadow(0 0 40px rgba(255,180,210,0.8));
  }
}


.preview-overlay {
    position: absolute;
    top: 50%;  /* Center vertically */
    left: 50%;
    transform: translate(-50%, -50%);  /* Perfect center */
    pointer-events: none;
    z-index: 20;
}

.preview-text {
    text-align: center;  /* Center align the text */
}

.preview-text p {
    font-size: 42px;  /* Smaller size to fit inside frame */
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 0 20px rgba(245, 113, 138, 0.8),
        0 0 40px rgba(245, 113, 138, 0.6),
        3px 3px 0px rgba(0, 0, 0, 0.5);
    margin: 5px 0;
    animation: preview-pulse 1.5s ease-in-out infinite;
    font-family: 'PhotoboothFont', Arial, sans-serif;
    line-height: 1.1;
}

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

/* Settings Panel */
#settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Make settings follow calibration (zoom + offset) */
    transform-origin: center center;
    transform: var(--pb-cal, none);

    /* NEW: use Galter font */
    font-family: 'Galter', Arial, sans-serif;
}



#settings-panel.hidden {
    display: none;
}

.settings-content {
    display: flex;
    gap: 40px;
    padding: 40px;
    max-width: 1400px;
    width: 90%;
}

.settings-left {
    flex: 1;
    padding: 30px;
    background: #CCCCFF;
    border: 2px solid #666;
    border-radius: 10px;
    max-height: 100vh;
    overflow-y: auto;
}

.settings-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: #CCCCFF;
    border: 2px solid #666;
    border-radius: 10px;
}

.settings-left h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #000000;
    font-family: 'Galter', Arial, sans-serif; /* changed */
}


.option-grid {
    display: grid;
    grid-template-columns: repeat(6, 60px);
    gap: 10px;
    margin-bottom: 30px;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
    width: 100%;
}

.color-option {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-option:hover {
    border-color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.color-option.selected {
    border-color: #0f0;
    box-shadow: 0 0 20px #0f0;
    transform: scale(1.1);
}

.logo-option, .decoration-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(60, 60, 60, 0.6);
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.logo-option:hover, .decoration-option:hover {
    background: rgba(80, 80, 80, 0.8);
    border-color: #fff;
}

.logo-option.selected, .decoration-option.selected {
    border-color: #0f0;
    background: rgba(0, 100, 0, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.logo-option img, .decoration-option img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-option span,
.decoration-option span {
    font-size: 18px;
    color: #fff; /* white text */
    font-family: 'Galter', Arial, sans-serif; /* same font as panel */
}



.controls-hint {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #666;
}

.controls-hint p {
    font-size: 14px;
    color: #aaa;
    margin: 5px 0;
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

#strip-preview {
    max-width: 100%;
    max-height: 600px;
    border: 3px solid #666;
    border-radius: 10px;
}

.color-label {
    text-align: center;
    font-size: 22px;
    color: #000;
    margin: 15px 0 25px 0;
    font-family: 'Galter', Arial, sans-serif;
}

/* Countdown Overlay */
#countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);  /* Light overlay so camera shows through */
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transform-origin: center center;
    transform: var(--pb-cal, none);  /* Follow calibration transform */
}


#countdown-overlay.hidden {
    display: none;
}

#countdown-number {
    font-size: 300px;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 0 20px #f73,
        0 0 40px #f73,
        0 0 60px #f73,
        0 0 80px #f73,
        5px 5px 10px rgba(0, 0, 0, 0.8);
    animation: countdown-pulse 1s ease-in-out infinite;
    font-family: 'PhotoboothFont', Arial, sans-serif;
    text-stroke: 3px #f73;
    -webkit-text-stroke: 3px rgba(247, 51, 51, 0.5);
}

@keyframes countdown-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

#photo-counter {
    position: absolute;
    top: 10%;  /* Top corner */
    right: 10%;  /* Right corner */
    transform: none;  /* No centering transform needed */
    font-size: 42px;  /* Good size for corner display */
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 30px #d43d8c,
        0 0 40px #d43d8c;
    background: rgba(0, 0, 0, 0.8);  /* Dark background for visibility */
    padding: 8px 20px;  /* Compact padding */
    border-radius: 10px;
    animation: corner-slide-in 0.3s ease-out;  /* Slide in animation */
    font-family: 'PhotoboothFont', Arial, sans-serif;
    border: 3px solid rgba(212, 61, 140, 0.9);
    z-index: 35;
    white-space: nowrap;
}

@keyframes corner-slide-in {
    0% { 
        transform: translateX(50px);
        opacity: 0;
    }
    100% { 
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse-counter {
    0% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Flash effect */
#flash-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

#flash-effect.flash-active {
    opacity: 1;
    transition: opacity 0.05s ease-in;
}

/* Final Strip Overlay */
#final-strip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #68ACAF 0%, #8B5B8E 50%, #D43D8C 100%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

#final-strip-overlay.hidden {
    display: none;
}

#final-strip-img {
    max-height: 80vh;
    max-width: 40vw;
    border: 6px solid #d43d8c;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(212, 61, 140, 0.6), 0 0 60px rgba(0, 217, 255, 0.4);
}

.final-hint {
    font-size: 24px;
    color: #fff;
    text-shadow: 0 0 10px #fff, 0 0 20px #d43d8c;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 30px;
    border-radius: 10px;
    animation: hint-pulse 2s ease-in-out infinite;
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.final-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.print-button {
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    background: rgba(138, 61, 212, 0.9);
    border: 3px solid #f73;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 25px rgba(255, 119, 51, 0.6);
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.print-button:hover {
    background: rgba(138, 61, 212, 1);
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(255, 119, 51, 0.8);
}

.print-button:active {
    transform: scale(0.98);
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #final-strip-img {
        visibility: visible;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 100%;
        max-height: 100%;
        border: none;
        box-shadow: none;
    }
}

/* Print Screen */
#print-screen {
    background: linear-gradient(135deg, 
        rgba(30, 30, 40, 0.98) 0%, 
        rgba(40, 30, 50, 0.98) 50%, 
        rgba(30, 40, 50, 0.98) 100%);
    z-index: 1200;
}

#print-content-layer {
    position: absolute;
    inset: 0;
    transform-origin: center center;
    transform: var(--pb-cal, none);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 20px;
}

.print-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-height: 60vh;
}

#print-preview-img {
    max-height: 100%;
    max-width: 100%;
    border: 4px solid rgba(255, 152, 184, 0.6);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(212, 61, 140, 0.4);
    transition: transform 0.2s ease;
}

.print-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 30px;
    border-radius: 12px;
    border: 2px solid rgba(255, 152, 184, 0.3);
}

.print-zoom-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#print-zoom-level {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 20px;
    color: #fff;
    min-width: 60px;
    text-align: center;
}

.print-control-btn {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: rgba(138, 61, 212, 0.8);
    border: 2px solid rgba(255, 119, 51, 0.6);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.print-control-btn.small {
    padding: 8px 15px;
    font-size: 18px;
}

.print-control-btn:hover,
.print-control-btn.focused {
    background: rgba(138, 61, 212, 1);
    border-color: #f73;
    box-shadow: 0 0 15px rgba(255, 119, 51, 0.5);
}

.print-printer-select {
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-printer-select label,
.print-copies label {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 18px;
    color: #fff;
}

.printer-dropdown {
    padding: 8px 15px;
    font-size: 16px;
    font-family: 'PhotoboothFont', Arial, sans-serif;
    background: rgba(60, 60, 80, 0.9);
    color: #fff;
    border: 2px solid rgba(255, 152, 184, 0.5);
    border-radius: 6px;
    cursor: pointer;
    min-width: 200px;
}

.printer-dropdown:focus,
.printer-dropdown.focused {
    border-color: #f73;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 119, 51, 0.5);
}

.print-copies {
    display: flex;
    align-items: center;
    gap: 10px;
}

#copies-count {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 24px;
    color: #fff;
    min-width: 40px;
    text-align: center;
}

.print-action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.print-confirm-button {
    padding: 15px 40px;
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    background: rgba(46, 160, 67, 0.9);
    border: 3px solid #4ade80;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.print-confirm-button:hover,
.print-confirm-button.focused {
    background: rgba(46, 160, 67, 1);
    box-shadow: 0 0 25px rgba(74, 222, 128, 0.6);
    transform: scale(1.05);
}

.print-cancel-button {
    padding: 15px 40px;
    font-size: 22px;
    font-weight: bold;
    color: #fff;
    background: rgba(180, 60, 60, 0.9);
    border: 3px solid #f87171;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

.print-cancel-button:hover,
.print-cancel-button.focused {
    background: rgba(180, 60, 60, 1);
    box-shadow: 0 0 25px rgba(248, 113, 113, 0.6);
    transform: scale(1.05);
}

.print-hint {
    font-family: 'Galter', Arial, sans-serif;
    font-size: 14px;
    color: #fff;
    opacity: 0.6;
    text-align: center;
}

@keyframes hint-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Loading Indicator */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#loading.hidden {
    display: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading p {
    font-size: 28px;
    color: #fff;
    text-shadow: 0 0 20px rgba(212, 61, 140, 0.8);
    animation: loading-pulse 1.5s ease-in-out infinite;
    font-family: 'PhotoboothFont', Arial, sans-serif;
}

@keyframes loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Responsive adjustments */
@media (min-width: 1600px) {
    /* On ultra-wide screens, keep centered layout */
    .preview-text p {
        font-size: 48px;
    }
    
    #photo-counter {
        font-size: 48px;
        top: 8%;
        right: 8%;
    }
}

@media (max-width: 1200px) {
    #photobooth-canvas {
        width: 70vh;
        height: 70vh;
    }
    
    .preview-text p {
        font-size: 36px;
    }
    
    #photo-counter {
        font-size: 36px;
        padding: 6px 16px;
        top: 10%;
        right: 10%;
    }
}

@media (max-width: 768px) {
    #photobooth-canvas {
        width: 80vh;
        height: 80vh;
        border-width: 8px;
        border-radius: 20px;
    }
    
    .preview-text p {
        font-size: 28px;
    }
    
    #photo-counter {
        font-size: 32px;
        padding: 5px 12px;
        top: 12%;
        right: 12%;
    }
    
    .start-text {
        font-size: 24px;
    }
    
    #final-strip-img {
        max-width: 60vw;
    }
    
    #countdown-number {
        font-size: 200px;
    }
}
/* --- Preview screen calibration --- */
#preview-screen { position: fixed; inset: 0; }
#preview-screen::before { content: ""; position: absolute; inset: 0; z-index: 1; }
/* Keyboard navigation focus states */
.color-option.focused {
    border-color: #ff0 !important;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.8) !important;
    transform: scale(1.15) !important;
    outline: 3px dashed #ff0;
    outline-offset: 2px;
}

.logo-option.focused,
.decoration-option.focused {
    border-color: #ff0 !important;
    background: rgba(100, 100, 0, 0.3) !important;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.8) !important;
    transform: translateX(8px) !important;
    outline: 2px dashed #ff0;
    outline-offset: 2px;
}

/* Calibrate button */
.calibrate-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(100, 163, 255, 0.2);
    border: 2px solid rgba(100, 163, 255, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.calibrate-button:hover {
    background: rgba(100, 163, 255, 0.3);
    border-color: rgba(100, 163, 255, 0.8);
    transform: translateX(5px);
}

.calibrate-button.focused {
    border-color: #ff0 !important;
    background: rgba(255, 255, 0, 0.2) !important;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.8) !important;
    transform: translateX(8px) !important;
    outline: 2px dashed #ff0;
    outline-offset: 2px;
}

.calibrate-icon {
    font-size: 32px;
}

.calibrate-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.calibrate-text strong {
    font-size: 18px;
    color: #000; /* black text */
    font-family: 'Galter', Arial, sans-serif; /* same as settings panel */
}

.calibrate-text small {
    font-size: 14px;
    color: #000; /* also black – or use #333 if you want softer */
    font-family: 'Galter', Arial, sans-serif;
}

/* Overlay image that zooms in/out in sync with "Press SPACE" */
#splash2-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* over base splash, under particles & text */
    transform-origin: center center;
    animation: splash2Zoom 1.5s ease-in-out infinite;
}

/* same rhythm as .start-text's pulse-text (1.5s loop) */
@keyframes splash2Zoom {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
/* Heart overlay (splash5) that follows the idle zoom/crop */
#splash5-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;        /* keep heart proportions */
  z-index: 3;                 /* above splash2/3/4 and particles */
  opacity: 0;                 /* hidden by default */
  transform-origin: center center;
  pointer-events: none;
}

/* When active: visible + vibrating */
#splash5-image.heart-pop {
  opacity: 1;
  animation: heartVibrate 0.55s ease-out;
}

/* Vibration / shake animation */
@keyframes heartVibrate {
  0%   { transform: translate(0, 0) scale(1.0); }
  20%  { transform: translate(-3px, 2px) scale(1.04); }
  40%  { transform: translate(3px, -2px) scale(1.05); }
  60%  { transform: translate(-2px, 1px) scale(1.03); }
  80%  { transform: translate(2px, -1px) scale(1.04); }
  100% { transform: translate(0, 0) scale(1.0); }
}
.logo-tuning-label {
  margin: 6px 0 10px;
  font-size: 0.85rem;
  opacity: 0.8;
  color: #000000;
}

.logo-tuning-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: #000000;
}

.logo-tuning-row span {
  flex: 1;
  font-size: 0.9rem;
  color: #000000;
}

.logo-tune-btn {
  width: 32px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #555;
  background: #26212e;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.logo-tune-btn:hover {
  background: #3b3446;
  
}
.logo-fine-buttons button,
#logo-reset {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #282331;
  color: #fff;
  font-size: 13px;
}

#logo-reset {
  background: #393147;
}

.logo-fine-label {
  font-size: 12px;
  opacity: 0.75;
}
/* "Manage strip colors" button – same vibe as other cards */
.settings-subbtn {
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;

  display: flex;
  align-items: center;
  gap: 12px;

  border-radius: 8px;
  border: 2px solid rgba(104, 172, 163, 0.6);
  background: rgba(104, 172, 163, 0.18);

  color: #000;
  font-family: 'Galter', Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-align: left;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* Small icon bubble on the left */
.settings-subbtn::before {
  content: "🎛️";
  font-size: 22px;
}

/* Hover / focus feel like the calibrate button */
.settings-subbtn:hover {
  background: rgba(104, 172, 163, 0.28);
  border-color: rgba(104, 172, 163, 0.9);
  transform: translateX(5px);
  box-shadow: 0 0 12px rgba(104, 172, 163, 0.6);
}

.settings-subbtn:focus {
  outline: 2px dashed #ff0;
  outline-offset: 2px;
}
/* Focus state for logo fine-tune buttons (keyboard nav) */
.logo-tune-btn.focused,
#logo-reset.focused {
  border-color: #ff0 !important;
  background: rgba(255, 255, 0, 0.1) !important;
  box-shadow: 0 0 12px rgba(255, 255, 0, 0.8) !important;
  outline: 2px dashed #ff0;
  outline-offset: 2px;
}

/* Focus state for "Manage strip colors" button */
.settings-subbtn.focused {
  border-color: #ff0 !important;
  background: rgba(255, 255, 0, 0.12) !important;
  box-shadow: 0 0 15px rgba(255, 255, 0, 0.85) !important;
  transform: translateX(8px);
  outline: 2px dashed #ff0;
  outline-offset: 2px;
}

/* Return to idle button in settings */
.settings-return-button {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 16px 24px;
  
  border-radius: 12px;
  border: 3px solid rgba(245, 113, 138, 0.8);
  background: rgba(245, 113, 138, 0.25);
  
  color: #fff;
  font-family: 'Galter', Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(245, 113, 138, 0.4);
}

.settings-return-button:hover {
  background: rgba(245, 113, 138, 0.45);
  border-color: rgba(245, 113, 138, 1);
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(245, 113, 138, 0.7);
}

.settings-return-button:active {
  transform: scale(0.98);
}

/* === BIGGER SETTINGS MENU TYPOGRAPHY ===================== */

/* Base text inside settings */
#settings-panel .settings-content {
  font-size: 20px;          /* base body text for settings */
  line-height: 1.5;
}

/* Section titles: Display Mode, Aspect Ratio, Strip format, etc. */
#settings-panel .settings-left h2 {
  font-size: 32px;
  margin-bottom: 20px;
}

/* Each clickable row: colors, logos, decorations, strip format, etc. */
#settings-panel .logo-option,
#settings-panel .decoration-option,
#settings-panel .calibrate-button,
#settings-panel .settings-subbtn {
  font-size: 20px;
  padding: 14px 18px;
}

/* Text inside logo/deco items */
#settings-panel .logo-option span,
#settings-panel .decoration-option span {
  font-size: 22px;
}

/* Calibrate card text */
#settings-panel .calibrate-text strong {
  font-size: 22px;
}

#settings-panel .calibrate-text small {
  font-size: 16px;
}

/* Manage strip colors button text */
#settings-panel .settings-subbtn {
  font-size: 18px;
}

/* Controls hint at bottom ("Press S for settings" etc.) */
#settings-panel .controls-hint p {
  font-size: 18px;
}

/* Logo fine-tune label + mini text */
#logo-tuning-label,
.logo-tuning-label {
  font-size: 18px;
}

.logo-tuning-row span {
  font-size: 18px;
}

.logo-fine-label {
  font-size: 16px;
}

/* Buttons for fine-tune + reset */
/* Reset button = full text pill */
#logo-reset {
  font-size: 18px;
  padding: 8px 14px;
  width: auto;
  height: auto;
  white-space: nowrap;
  display: inline-block;
}

/* ===== Pretty scrollbar for the settings panel ===== */
.settings-left {
    /* keep your existing styles */
    scrollbar-width: thin;                  /* Firefox */
    scrollbar-color: #8a3dd4 #c7c0ff;       /* thumb / track */
}

/* Chrome / Edge / Safari */
.settings-left::-webkit-scrollbar {
    width: 10px;
}

.settings-left::-webkit-scrollbar-track {
    background: #c7c0ff;
    border-radius: 999px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.25);
}

.settings-left::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff7733, #8a3dd4);
    border-radius: 999px;
    border: 2px solid #c7c0ff;
}

.settings-left::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff995c, #a154e5);
}
/* Generic back button for overlay screens (desktop only – mobile has its own) */
.screen-back-button {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 25;

    padding: 8px 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.85);

    background: radial-gradient(
        circle at 30% 0%,
        rgba(255, 255, 255, 0.18),
        rgba(102, 51, 153, 0.96)
    );
    color: #fff;
    font-family: 'PhotoboothFont', Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    box-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.screen-back-button:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.9);
}

.screen-back-button:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.8);
}
/* CRAZY MODE: much faster + stronger zoom on splash2/3/4 */
body.crazy-mode #splash2-image {
    animation: splash2CrazyZoom 0.4s ease-in-out infinite;
}

@keyframes splash2CrazyZoom {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}
@media print {
  /* Remove page margins */
  @page {
    margin: 0;
    size: auto; /* or specify: size: 4in 6in; for Canon Selphy */
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    width: 100% !important;
    background: #fff !important;
    overflow: visible !important;
  }

  /* Hide everything by default */
  body * {
    visibility: hidden !important;
    display: none !important;
  }

  /* Show only the final strip overlay and its image */
  #final-strip-overlay,
  #final-strip-overlay *,
  #final-strip-img {
    visibility: visible !important;
    display: block !important;
  }

  /* Reset the overlay to fill page */
  #final-strip-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    transform: none !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Make the image fill the page properly */
  #final-strip-img {
    position: relative !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Hide all buttons and hints */
  .final-actions,
  .final-hint,
  .print-button {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ensure no transforms interfere */
  * {
    transform: none !important;
    filter: none !important;
  }
}

/* Canon Selphy specific sizing (4x6 photo paper) */
@media print and (max-width: 6in) {
  @page {
    size: 4in 6in portrait;
    margin: 0;
  }
  
  #final-strip-img {
    max-width: 4in !important;
    max-height: 6in !important;
  }
}

/* Dropbox repo input in Advanced settings */
.repo-input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    padding: 4px 8px;
    color: #fff;
    font-family: 'Galter', Arial, sans-serif;
    font-size: 14px;
}

.repo-save-btn {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Galter', Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
}

/* ============================================
   PHOTO ASPECT SELECTOR
   ============================================ */

/* Container for photo aspect selector */
.photo-aspect-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Label text */
.aspect-label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 8px;
}

/* Aspect toggle buttons */
.aspect-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.aspect-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.aspect-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.aspect-icon {
    font-size: 20px;
}

.aspect-text {
    font-size: 14px;
}

/* Mobile adjustments */
@media (max-width: 768px), (pointer: coarse) {
    .photo-aspect-selector {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .aspect-label {
        font-size: 14px;
        margin-right: 0;
        margin-bottom: 4px;
    }
    
    .aspect-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}
