﻿html, body {
    overflow-x: hidden;
}
body {
    margin: 0;
    font-family: 'Cinzel', serif;
    background: linear-gradient(#0a0a0a, #1a1a1a);
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: #111;
    padding: 1rem 2rem;
    border-bottom: 2px solid #4c3b2a;
    text-align: center;
}

    header h1 {
        margin: 0;
        font-size: 2rem;
        color: #ffcc66;
    }
.site-header {
    background: url('/images/roundtable.png') no-repeat center center;
    background-size: cover;
    color: #eee;
    padding: 1rem 2rem 0.5rem;
    border-bottom: 2px solid #2e2e33;
    font-family: 'Segoe UI', sans-serif;
}

.overlay {
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 1rem;
}

/* Header row layout */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.site-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fafafa;
}
.nav-center {
    flex-grow: 1;
    text-align: center;
}

.top-bar-auth-status {
    text-align: right;
    font-size: 0.85rem;
    color: #b0bac0;
}

    .top-bar-auth-status.login-or-register {
        font-weight: bold;
    }

    /* Queue bar below header */
    .queue-bar {
        padding-top: 0.5rem;
        border-top: 1px solid #444;
    }
    .desktop-queue-bar {
        display: block;
    }

    .mobile-queue-bar {
        display: none;
    }

.queue-block {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 8px rgba(100,180,255, 0.1);
    }

    50% {
        box-shadow: 0 0 15px rgba(100,180,255, 0.25);
    }

    100% {
        box-shadow: 0 0 8px rgba(100,180,255, 0.1);
    }
}
.queue-block.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem auto;
    padding: 0.5rem;
    max-width: 100%;
    text-align: center;
    /***/
    animation: pulse-glow 3s ease-in-out infinite;
    /***/

    background: rgba(20, 20, 30, 0.6); /* semi-transparent dark */
    border: 1px solid #444;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(100, 180, 255, 0.15);
    backdrop-filter: blur(6px);
    max-width: fit-content;
}

.status-label {
    font-weight: bold;
    color: #b0bac0;
    white-space: nowrap;
}

.tag {
    background-color: #2e2e33;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: #ccc;
    border: 1px solid #444;
}
/* Group found state styling */
.queue-bar.group-found .queue-block.centered {
    background: linear-gradient(135deg, rgba(160, 120, 60, 0.9) 0%, rgba(212, 175, 55, 0.8) 50%, rgba(255, 215, 0, 0.7) 100%);
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(160, 120, 60, 0.2);
    animation: group-found-glow 1.5s ease-in-out infinite alternate;
}

.queue-bar.group-found .status-label {
    color: #1a1a1a;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
}

@keyframes group-found-glow {
    0% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), 0 0 30px rgba(160, 120, 60, 0.2);
        border-color: #d4af37;
    }

    100% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), 0 0 50px rgba(160, 120, 60, 0.3);
        border-color: #ffd700;
    }
}
/*navigation */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
    margin: 0rem auto;
    padding: 0 1rem;
    overflow-x: auto;
}

    nav a {
        color: #cccccc;
        text-decoration: none;
        font-weight: bold;
        transition: color 0.3s;
    }

        nav a:hover {
            color: #ffcc66;
        }

.nav-link {
    color: #cccccc;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
}

    .nav-link:hover {
        color: #ffcc66;
        background-color: rgba(255, 204, 102, 0.05);
    }

@media (max-width: 1000px) {
    nav {
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0;
        margin: 0.25rem 0;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }
}
main {
    flex: 1;
    padding: 1.25rem;
    max-width: 900px;
    margin: auto;
}

section.hero {
    background: rgba(255, 204, 102, 0.05);
    border: 1px solid #444;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

    section.hero h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: #ffcc66;
    }

    section.hero p {
        font-size: 1.1rem;
        line-height: 1.6;
        color: #ccc;
    }

footer {
    background-color: #111;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    border-top: 2px solid #4c3b2a;
    color: #888;
}


/** Player cards */
main {
    background-color: #111;
    color: #ddd;
}

    .main h2, main h1 {
        margin-bottom: 1rem;
        color: #d0b773;
    }


/* Join queue and register pages */
.form-container {
    max-width: 640px;
    margin: 0.5rem auto;
    background: #1b212f;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(136, 204, 255, 0.12);
}

label {
    font-weight: 600;
    color: #a0acc0;
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 1.25rem;
}

input,
select,
.checkbox-group input {
    padding: 0.65rem;
    border-radius: 6px;
    border: none;
    background: #232a3a;
    color: #e0e6ed;
    width: 100%;
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

    .checkbox-group label {
        background: #2a3246;
        padding: 0.4rem 0.8rem;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.9rem;
        transition: background 0.2s;
    }

        .checkbox-group label:hover {
            background: #3a4764;
        }

button {
    background: #a0783c;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
}

    button:hover {
        background: #b88e4e;
    }
.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #a0acc0;
    width: 100%;
}
    .remember-me input {
        width: auto;
    }



a {
    color: #cccccc;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

    a:hover {
        color: #ffcc66;
    }

.alert-success {
    background-color: #2f3b2f; /* deep moss green */
    color: #d0e6cd; /* pale mossy white-green */
    border-left: 4px solid #5a7c5a; /* muted highlight */
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-size: 0.95rem;
    box-shadow: 0 0 10px rgba(90, 124, 90, 0.2);
}
    .alert-success a {
        color: #b8dcb0; /* soft leaf green */
        text-decoration: underline;
        font-weight: 500;
        transition: color 0.2s ease;
    }

        .alert-success a:hover {
            color: #d0f0c0; /* lighter green glow on hover */
        }

.form-note {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #ccc;
}

    .form-note a {
        color: #d0b36a; /* dark gold */
        text-decoration: underline;
    }

        .form-note a:hover {
            color: #f1cf89;
        }

/** Login **/
.message-container {
    padding: 1.5rem 2rem;
    background-color: #2f2a24;
    border-left: 5px solid #6a5f3e;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(106, 95, 62, 0.2);
    text-align: center;
}

.message {
    font-size: 1.1rem;
    color: #d9c8a8;
}

    .message.username {
        font-weight: bold;
        color: #f3e8c4;
    }

/** Join queue */
.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
}
.notification-notice.highlight {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    animation: gentle-pulse 2s infinite;
}

@keyframes gentle-pulse {
    0%, 100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.fog-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('/images/fog-texture.png') repeat;
    background-size: 300%;
    background-color: rgba(0, 0, 0, 0.1); /* Initial low opacity */
    opacity: 0;
    transition: opacity 1s ease-in-out, background-color 1s ease-in-out;
    animation: fogFloat 40s linear infinite;
    pointer-events: none;
    z-index: 9998;
}

.fog-in {
    opacity: 1;
}

.fog-out {
    opacity: 0;
}

.fog-darken {
    background-color: rgba(0, 0, 0, 0.85); /* Much darker fog */
}

/* Glyph container, always rendered */
.glyph-container {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 1.2s ease, transform 1.2s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    text-align: center;
    pointer-events: none;
    color: #ddd;
}

    .glyph-container.fade-in {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

.glyph-spin img {
    width: 180px;
    height: 180px;
    animation: spin 10s linear infinite;
    filter: drop-shadow(0 0 12px #aaa);
}
img.mini-glyph-spin {
    height: 1em; /* match the font-size line height */
    width: auto; /* keep aspect ratio */
    vertical-align: middle; /* align nicely with text */

    animation: spin 8s linear infinite;
    filter: drop-shadow(0 0 12px #aaa);
}

.glyph-message {
    margin-top: 1.5rem;
    font-size: 1.4rem;
    color: #ccc;
    text-shadow: 0 0 5px #000;
}

@keyframes fogFloat {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/**Mobile styles*/
@media (max-width: 1000px) {

    header {
        padding: 0 !important;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .site-title {
        font-size: 1.4rem;
    }

    .site-header {
        background-position: center -35px; /* shift image up */
    }

    .site-title,
    .nav-center,
    .top-bar-auth-status {
        text-align: center;
        width: 100%;
    }

    .queue-block.centered {
        max-width: 100%;
    }

    .desktop-queue-bar {
        display: none;
    }

    .mobile-queue-bar {
        display: block;
    }

    nav {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        margin: 0;
    }

    .queue-bar {
        border-top: 0;
        padding-top: 0;
        margin-top: 0.5rem;
    }

    .queue-block.centered {
        margin: 0;
    }

    .nav-link {
        scroll-snap-align: center;
    }

    main {
        padding: 0.75rem;
    }

    .form-container {
        padding: 1.5rem;
        margin: 2rem 1rem;
    }

    .player-details {
        flex-direction: column;
        gap: 0.75rem;
    }

    .glyph-message {
        font-size: 1.1rem;
        margin-top: 1rem;
    }

    .glyph-spin img {
        width: 140px;
        height: 140px;
    }

    .message {
        font-size: 1rem;
    }

    section.hero h2 {
        font-size: 1.5rem;
    }

    section.hero p {
        font-size: 1rem;
    }

    .alert-success {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .form-container input,
    .form-container select,
    .form-container button {
        width: 100%;
        box-sizing: border-box;
    }

    .form-note {
        font-size: 0.9rem;
    }
}

/* update banner */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #a0783c, #d0b773);
    color: #fff;
    padding: 0.75rem;
    box-shadow: 0 0 15px rgba(160, 120, 60, 0.25);
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
    border-bottom: 2px solid #4c3b2a;
    font-family: 'Cinzel', serif;
}

.update-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.btn-update, .btn-dismiss {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9rem;
}

.btn-update {
    background: #ffcc66;
    color: #222;
    border: 1px solid #e6b84d;
}

    .btn-update:hover {
        background: #f1cf89;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

.btn-dismiss {
    background: rgba(255,255,255,0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.2);
}

    .btn-dismiss:hover {
        background: rgba(255,255,255,0.2);
        color: #fff;
    }

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

@media (max-width: 1000px) {
    .update-banner {
        padding: 0.5rem;
    }

    .update-content {
        gap: 0.75rem;
        text-align: center;
    }

    .btn-update, .btn-dismiss {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/**group found animation */
.group-found-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(139, 69, 19, 0.9) 0%, rgba(25, 25, 35, 0.95) 70%, rgba(0, 0, 0, 1) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

    .group-found-overlay.visible {
        opacity: 1;
        pointer-events: all;
    }

.golden-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 6px #ffd700, 0 0 12px #ffd700;
    animation: float 4s infinite ease-in-out;
}

.group-formation {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    animation: slideUp 1.2s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
    position: relative;
}

.player-slot {
    position: relative;
    width: 80px;
    height: 80px;
    border: 3px solid #8b4513;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.3) 0%, rgba(139, 69, 19, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: playerGlow 2s infinite alternate;
}

.player-icon {
    width: 40px;
    height: 40px;
    background: #ffd700;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

    .player-icon::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        background: #8b4513;
        border-radius: 50%;
    }

.connection-lines {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
    z-index: -1;
}

.connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #ffd700 50%, transparent 100%);
    top: 0;
    animation: connectionPulse 3s infinite;
}

.line-1 {
    left: 13%;
    width: 24%;
    animation-delay: 0s;
}

.line-2 {
    left: 63%;
    width: 24%;
    animation-delay: 0.5s;
}

.group-found-text {
    color: #ffd700;
    font-size: 3.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    margin-bottom: 20px;
    animation: textGlow 2s ease-in-out infinite alternate;
    opacity: 0;
    animation: slideUp 1.5s ease-out 0.5s forwards, textGlow 2s ease-in-out 2s infinite alternate;
}

.subtitle {
    color: #d4af37;
    font-size: 1.5rem;
    text-align: center;
    opacity: 0;
    animation: slideUp 1.5s ease-out 1s forwards;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.ready-prompt {
    position: absolute;
    bottom: 80px;
    color: #ffd700;
    font-size: 1.2rem;
    text-align: center;
    opacity: 0;
    animation: slideUp 1.5s ease-out 2s forwards, pulse 2s ease-in-out 3.5s infinite;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes playerGlow {
    from {
        border-color: #8b4513;
        box-shadow: 0 0 20px rgba(139, 69, 19, 0.5);
    }

    to {
        border-color: #ffd700;
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

@keyframes connectionPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleX(0.8);
    }

    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.4);
    }

    to {
        text-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 215, 0, 0.6);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

.central-emblem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 4px solid #ffd700;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: emblemRotate 8s linear infinite;
    opacity: 0.8;
}

    .central-emblem::before {
        content: '';
        position: absolute;
        width: 60px;
        height: 60px;
        border: 2px solid #8b4513;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(139, 69, 19, 0.3) 0%, transparent 100%);
    }

@keyframes emblemRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .group-formation {
        gap: 25px;
    }

    .player-slot {
        width: 60px;
        height: 60px;
    }

    .player-icon {
        width: 30px;
        height: 30px;
    }

        .player-icon::before {
            width: 15px;
            height: 15px;
        }

    .group-found-text {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .central-emblem {
        width: 80px;
        height: 80px;
    }

        .central-emblem::before {
            width: 40px;
            height: 40px;
        }
}
