/*

	www/styles.css
	&copy; rattatwinko.servecounterstrike.com
	Written first: 27JUL2025
	Rewritten:	   29JUL2025@03:12:37
*/

:root {
    --padding: 20px;
    --qr-size: 150px;
    --qr-size-mobile: 120px;
    --qr-gap: 24px;
    --primary-bg: #121212;
    --primary-text: #eee;
    --secondary-text: #aaa;
    --accent-text: #fff;
    --button-bg: #ffffff;
    --button-text: #000;
    --button-hover: #e0e0e0;
    --footer-bg: #0f0f0f;
    --border-color: #333;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
    font-family: "JetBrains Mono", monospace;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: var(--padding);
}

h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin: 0 0 0.2em 0;
    color: var(--accent-text);
    font-weight: 700;
}

h2 {
    font-weight: 400;
    color: var(--secondary-text);
    margin: 0 0 1em 0;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.subtitle {
    margin: -5px 0 15px 0;
    opacity: 0.5;
    font-style: italic;
}

.subtitle p {
    margin: 0;
}

.qr-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--qr-gap);
    justify-content: center;
    margin-bottom: 2em;
    width: 100%;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.qr-label {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 0.3em;
    color: #ccc;
}

.qr-container img {
    width: var(--qr-size);
    height: var(--qr-size);
    object-fit: contain;
    filter: drop-shadow(0 0 6px #000);
    transition: transform 0.2s ease;
    border-radius: 8px;
}

.qr-container a {
    display: block;
    transition: transform 0.2s ease;
}

.qr-container a:hover {
    transform: scale(1.05);
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
}

.button {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
    padding: 14px 20px;
    border-radius: 8px;
    background-color: var(--button-bg);
    color: var(--button-text);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    font-size: 1em;
    display: inline-block;
}

.button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0);
}

.timer-display {
    text-align: center;
    font-size: 0.9em;
    color: var(--secondary-text);
    margin-top: 1em;
    min-height: 1.5em;
    font-weight: 400;
}

/* Footer Styles */
footer {
    width: 100%;
    padding: 20px var(--padding);
    text-align: center;
    font-size: 0.9em;
    color: var(--secondary-text);
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background-color: var(--footer-bg);
}

footer p {
    margin: 0;
    line-height: 1.6;
}

footer a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    word-break: break-word;
}

footer a:hover {
    color: var(--accent-text);
    text-decoration: underline;
}

/* Mobile Styles */
@media (max-width: 600px) {
    :root {
        --padding: 15px;
    }

    .qr-container img {
        width: var(--qr-size-mobile);
        height: var(--qr-size-mobile);
    }

    .qr-group {
        justify-content: center;
        gap: calc(var(--qr-gap) * 0.75);
    }

    /* Make QR codes display 2 per row on mobile when there are 3+ items */
    .qr-group:has(.qr-container:nth-child(3)) {
        justify-content: space-around;
    }

    .qr-group:has(.qr-container:nth-child(3)) .qr-container {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }

    .button {
        flex: 1 1 100%;
        width: 100%;
        min-width: unset;
    }

    /* Footer responsive adjustments */
    footer {
        font-size: 0.8em;
        padding: 15px var(--padding);
    }

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

    .footer-text a {
        font-size: 0.9em;
    }
}

/* Tablet Styles */
@media (min-width: 601px) and (max-width: 1024px) {
    .qr-group:has(.qr-container:nth-child(4)) {
        max-width: calc(var(--qr-size) * 3 + var(--qr-gap) * 2);
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .welcome-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .button-container,
    .timer-display {
        display: none;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

#datamatrix {
  display:block;
  margin-left:auto;
  background-color: white;
  border-radius: 6px;
  padding: 4px;
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.4));
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  #datamatrix {
    /* Reduce size on mobile */
    width: 80px;
    height: 80px;
    
    /* Adjust position to avoid header elements */
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    
    /* Make it slightly transparent when not hovered */
    opacity: 0.9;
  }

  #datamatrix:hover {
    /* Full opacity when interacted with */
    opacity: 1;
  }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
  #datamatrix {
    /* Even smaller on very small screens */
    width: 60px;
    height: 60px;
    
    /* Move down if there's a header banner */
    top: max(50px, env(safe-area-inset-top));
  }
}

/* Portrait orientation specific adjustments */
@media (max-width: 768px) and (orientation: portrait) {
  #datamatrix {
    /* More top space in portrait to avoid browser UI */
    top: max(20px, env(safe-area-inset-top));
  }
}

/* Safe area handling for notched devices */
@supports (padding: max(0px)) {
  #datamatrix {
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
  }
}