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

html {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
    background: linear-gradient(180deg,
        rgba(139, 30, 35, 0.15) 10%,
        rgba(196, 30, 58, 0.20) 15%,
        rgba(196, 30, 58, 0.25) 20%,
        rgba(255, 123, 0, 0.6) 40%,
        rgba(74, 100, 145, 0.5) 55%,
        rgba(43, 76, 140, 0.7) 75%,
        rgba(26, 56, 117, 0.9) 100%
    );
    background-attachment: fixed;
    -webkit-background-attachment: fixed;
    -moz-background-attachment: fixed;
    -ms-background-attachment: fixed;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Roboto Mono', Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    color: #fff;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg,
        rgba(139, 30, 35, 0.15) 10%,
        rgba(196, 30, 58, 0.20) 15%,
        rgba(196, 30, 58, 0.25) 20%,
        rgba(255, 123, 0, 0.6) 40%,
        rgba(74, 100, 145, 0.5) 55%,
        rgba(43, 76, 140, 0.7) 75%,
        rgba(26, 56, 117, 0.9) 100%
    );
    background-attachment: fixed;
    -webkit-background-attachment: fixed;
    -moz-background-attachment: fixed;
    -ms-background-attachment: fixed;
}

.main-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 120px; /* Adjust based on footer height */
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card {
    background: linear-gradient(135deg, #1a1f5e, #3083aa);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 20px auto;
    max-width: 98%;
    width: 1000px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 16px; /* Add explicit font size */
    transform: translateZ(1px);
    -webkit-font-smoothing: antialiased; /* Consistent font rendering */
    -moz-osx-font-smoothing: grayscale;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 2;
    position: relative;
    transform-style: preserve-3d;
}

h1 {
    font-size: 2rem;
    margin: 30px 0;
    text-align: center;
    color: #fff;
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
    width: 100%;
}

.countdown-item {
    width: 100%;
    min-width: 140px;
    height: 120px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: transform 0.3s ease, background-color 0.3s ease;
    margin: 0;
}

.countdown-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.2);
}

.number {
    font-size: 3.5rem;
    font-weight: bold;
    color: #fff;
    opacity: 0.9;
    min-width: 3ch;
    display: block;
    text-align: center;
    line-height: 1;
    -webkit-text-size-adjust: none;
}

.label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    text-align: center;
    line-height: 1;
    margin-top: 5px;
}

.countdown-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 0 1rem;
}

.countdown-controls-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.popup-trigger {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.popup-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.popup-trigger:active {
    transform: translateY(0);
}

.control-icon {
    position: relative;
    cursor: pointer;
}

.control-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.8rem;
    z-index: 10;
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-icon[data-tooltip]:hover::after {
    opacity: 1;
}

.control-icon.live-ticker {
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-icon .viewer-count {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.viewer-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(22, 33, 62, 0.8);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    padding: 10px;
    text-align: center;
    z-index: 999;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.72rem;
    margin-top: auto;
}

footer a, 
footer a:visited,
footer a:link {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ff0000;
    text-decoration: underline;
}

footer .email {
    color: white;
    transition: color 0.3s ease;
}

footer .email:hover {
    color: #ff0000;
}

footer p {
    margin: 0;
}

audio {
    display: none;
}

.audio-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.audio-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.live-ticker.icon-button {
    height: 36px;
    padding: 0 15px;
}

.live-ticker.icon-button:hover {
    background: rgba(76, 175, 80, 0.3);
}

.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-container {
    background-color: #1a1a2e;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #16213e;
    color: #e94560;
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.modal-close {
    background: none;
    border: none;
    color: #e94560;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-content {
    padding: 20px;
    text-align: center;
}

.quote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.quote-emoji {
    font-size: 3rem;
}

.quote-text {
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1.6;
    max-width: 90%;
}

.quote-source {
    color: #e94560;
    font-style: italic;
    font-size: 1rem;
    opacity: 0.8;
}

.modal-footer {
    display: flex;
    justify-content: center;
    padding: 15px;
    background-color: #16213e;
}

.modal-action-btn {
    background-color: #e94560;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-action-btn:hover {
    background-color: #ff6b6b;
}

/* Modern iOS-style volume control */
.volume-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 24px;
    padding: 8px 16px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  
  .modern-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
  }
  
  .modern-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .modern-slider-container {
    position: relative;
    width: 120px;
    height: 36px;
    display: flex;
    align-items: center;
  }
  
  .modern-slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    pointer-events: none;
  }
  
  .modern-slider-fill {
    position: absolute;
    height: 100%;
    width: 50%; /* Default 50% */
    background: #007AFF; /* iOS blue */
    border-radius: 2px;
    left: 0;
    pointer-events: none;
    transition: width 0.1s;
  }
  
  .modern-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 36px;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    z-index: 2;
  }
  
  .modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: none;
  }
  
  .modern-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: none;
  }
  
  /* Position the audio controls */
  .audio-controls {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 900;
  }
  
  .audio-label {
    color: white;
    font-size: 0.9rem;
    margin-right: 5px;
  }
  
  /* iOS-specific adjustments */
  @supports (-webkit-touch-callout: none) {
    .modern-slider {
      height: 44px;
    }
    
    .modern-slider::-webkit-slider-thumb {
      width: 22px;
      height: 22px;
    }
    
    .volume-container {
      padding: 10px 18px;
    }
    
    .modern-button {
      width: 44px;
      height: 44px;
      font-size: 20px;
    }
  }  

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .audio-controls {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .slider {
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    input:checked + .slider {
        background-color: #64B5F6;
    }
}

@media (prefers-color-scheme: dark) {
    .audio-controls {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .slider {
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    input:checked + .slider {
        background-color: #64B5F6;
    }
}

@keyframes shake-card {
    0% { transform: translate(0, 0) rotate(0deg); }
    2.5% { transform: translate(-6px, 4px) rotate(-0.5deg); }
    5% { transform: translate(6px, -4px) rotate(0.5deg); }
    7.5% { transform: translate(-4px, -6px) rotate(-0.5deg); }
    10% { transform: translate(4px, 6px) rotate(0.5deg); }
    12.5% { transform: translate(-6px, -4px) rotate(-0.4deg); }
    15% { transform: translate(6px, 4px) rotate(0.4deg); }
    20% { transform: translate(-4px, -6px) rotate(-0.4deg); }
    25% { transform: translate(4px, 6px) rotate(0.4deg); }
    30% { transform: translate(-5px, -5px) rotate(-0.3deg); }
    35% { transform: translate(5px, 5px) rotate(0.3deg); }
    40% { transform: translate(-5px, -5px) rotate(-0.3deg); }
    45% { transform: translate(5px, 5px) rotate(0.3deg); }
    50% { transform: translate(-4px, -4px) rotate(-0.2deg); }
    55% { transform: translate(4px, 4px) rotate(0.2deg); }
    60% { transform: translate(-4px, -4px) rotate(-0.2deg); }
    65% { transform: translate(4px, 4px) rotate(0.2deg); }
    70% { transform: translate(-3px, -3px) rotate(-0.15deg); }
    75% { transform: translate(3px, 3px) rotate(0.15deg); }
    80% { transform: translate(-2px, -2px) rotate(-0.1deg); }
    85% { transform: translate(2px, 2px) rotate(0.1deg); }
    90% { transform: translate(-1px, -1px) rotate(-0.05deg); }
    95% { transform: translate(1px, 1px) rotate(0.05deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.shake, .shake-timer, .shake-light, .shake-days, .shake-hours, .shake-minutes, .shake-seconds {
    animation: shake-card 2.5s cubic-bezier(0.36, 0, 0.66, 1) forwards;
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

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

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

.countdown-timer .cd-seconds {
    transition: color 0.5s ease;
}

.countdown-timer .cd-seconds.warning-high {
    color: yellow;
}

.countdown-timer .cd-seconds.warning-medium {
    color: orange;
}

.countdown-timer .cd-seconds.warning-low {
    color: red;
}

/* Countdown Seconds Color Transitions */
#cd-seconds, 
#cu-seconds {
    transition: color 0.5s ease;
    color: white; /* Default color */
}

#cd-seconds.warning-high,
#cu-seconds.warning-high {
    color: yellow !important;
}

#cd-seconds.warning-medium,
#cu-seconds.warning-medium {
    color: orange !important;
}

#cd-seconds.warning-low,
#cu-seconds.warning-low {
    color: red !important;
}

@media (max-width: 1024px) {
    .card {
        width: 95%;
    }

    .countdown {
        gap: 20px;
    }

    .countdown-item {
        padding: 15px 30px;
        min-width: 140px;
    }

    .number {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .card {
        padding: 20px;
        margin: 10px auto;
    }
}

@media screen and (orientation: portrait) and (max-device-width: 926px) {
    #countup, #countdown {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 600px;
        width: 100%;
        margin: 0 auto;
        padding: 0 20px;
    }
}

@media screen and (orientation: landscape) {
    #countup, #countdown {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        width: 100%;
        margin: 0 auto;
        padding: 0 20px;
    }
}

@media screen and (orientation: portrait) and (min-device-width: 927px) {
    #countup, #countdown {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        width: 100%;
        margin: 0 auto;
        padding: 0 20px;
    }
}

.share-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.info-icon {
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 68, 68, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 68, 68, 0.3);
    position: absolute;
    right: 20px;
    bottom: 20px;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.2);
}

.info-icon::after {
    content: "→";
    font-size: 1.2em;
}

.info-icon:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.3);
    transform: translateX(3px);
}

.info-icon i {
    display: none;
}

.info-icon.hidden {
    display: none;
}

/* Ensure card has relative positioning for absolute icon placement */
.card {
    position: relative;
}

.info-link {
    color: #fff;
    font-size: 1.5em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.info-link:hover {
    color: #ff4444;
}

.info-link i {
    filter: drop-shadow(0 0 5px rgba(255, 68, 68, 0.5));
}

.splash-text {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg) scale(0);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: bold;
    color: #ff3b3b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5),
                 0 0 20px rgba(255, 59, 59, 0.8);
    white-space: nowrap;
    z-index: 3;
    opacity: 0;
    background: linear-gradient(45deg, #ff3b3b, #ff6b6b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding: 10px;
    border-radius: 10px;
    letter-spacing: 2px;
    max-width: 90%;
    overflow: hidden;
}

.splash-text.show {
    animation: splashIn 0.5s ease-out forwards,
               splashFloat 3s ease-in-out infinite,
               splashOut 0.5s ease-in forwards 60s;
}

@keyframes splashIn {
    0% {
        transform: translate(-50%, -50%) rotate(-35deg) scale(0);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) rotate(-35deg) scale(1);
        opacity: 1;
    }
}

@keyframes splashFloat {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(-35deg) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) rotate(-35deg) scale(1.05);
    }
}

@keyframes splashOut {
    0% {
        transform: translate(-50%, -50%) rotate(-35deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(-35deg) scale(0.8);
        opacity: 0;
    }
}

.notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 33, 62, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    text-align: center;
    width: 90%;
    max-width: 500px;
    margin-bottom: 60px;
}

.notice button {
    background: #4a648c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.notice button:hover {
    background: #5a749c;
}

.cookie-notice, .gdpr-notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 33, 62, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    text-align: center;
    width: 90%;
    max-width: 500px;
    margin-bottom: 60px; /* Add space above the footer */
}

.cookie-notice button, .gdpr-notice button {
    background: #4a648c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.cookie-notice button:hover, .gdpr-notice button:hover {
    background: #5a749c;
}

.notice-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 33, 62, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    text-align: center;
    width: 90%;
    max-width: 500px;
    margin-bottom: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.notice-banner button {
    background: #4a648c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.notice-banner button:hover {
    background: #5a749c;
}

/* Hidden elements */
.hidden {
    display: none;
}

.notice-banner {
    display: none; /* Hidden by default */
}

.notice-banner.visible {
    display: block;
}

/* Ensure proper z-indexing */
.container {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card {
    z-index: 2;
    position: relative;
    transform: translateZ(1px);
    transform-style: preserve-3d;
}
