﻿html {
    font-size: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    background: linear-gradient(135deg, #111111, #2a2a2a);
    background-size: 400% 400%;
    animation: backgroundMove 20s ease infinite;
    overflow: hidden;
    color: white;
}

@keyframes backgroundMove {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.layout-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 1000;
}

.app-content {
    margin-top: 200px;
    flex: 1;
    overflow-y: auto;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.overlay {
    margin-top: 40px;
    text-align: center;
}

.title {
    font-size: 5rem;
    font-weight: bold;
    color: white;
    animation: fadeInTop 2s ease-out forwards;
}

.subtitle {
    font-size: 2rem;
    color: #ffffff;
    margin-top: 0.8rem;
    animation: pulseGlow 2.5s ease-in-out infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

@keyframes fadeInTop {
    0% {
        opacity: 0;
        transform: translateY(-60px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255,255,255,0.3);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 12px rgba(255,255,255,0.6);
        opacity: 0.85;
    }
}

.back-icon-button {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    padding: 0.7rem;
    cursor: pointer;
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.15s ease, background 0.2s ease;
    z-index: 9999;
}

    .back-icon-button:hover {
        background: rgba(255,255,255,0.15);
        transform: scale(1.05);
    }

    .back-icon-button svg {
        width: 24px;
        height: 24px;
        fill: white;
    }

.button-container {
    position: fixed;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 90%;
    max-width: 700px;
    padding: 0 5vw;
}

.game-overlay .button-container {
    position: static;
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    z-index: 4;
}

.button-primary,
.button-secondary {
    width: 100%;
    padding: 2rem;
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 40px;
    color: white;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.3s ease;
    filter: brightness(1.05);
}

.button-primary {
    background: linear-gradient(135deg, #ff0055, #ff7700);
    box-shadow: 0 4px 15px rgba(255,0,85,0.4);
}

    .button-primary:hover {
        transform: scale(1.03);
        box-shadow: 0 6px 25px rgba(255,119,0,0.6);
        filter: brightness(1.1);
    }

    .button-primary:active {
        transform: scale(0.98);
        box-shadow: 0 3px 10px rgba(0,0,0,0.4);
        filter: brightness(0.95);
    }

.button-secondary {
    background: linear-gradient(135deg, #00c851, #007e33);
    box-shadow: 0 4px 15px rgba(0,200,81,0.4);
}

    .button-secondary:hover {
        transform: scale(1.03);
        box-shadow: 0 6px 25px rgba(0,200,81,0.6);
        filter: brightness(1.1);
    }

    .button-secondary:active {
        transform: scale(0.98);
        box-shadow: 0 3px 10px rgba(0,0,0,0.4);
        filter: brightness(0.95);
    }

.lobby-input {
    width: 100%;
    padding: 2rem;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 40px;
    border: none;
    outline: none;
    text-align: center;
    background: #2a2a2a;
    color: white;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

    .lobby-input::placeholder {
        color: #888;
        font-weight: normal;
    }

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(255,255,255,0.02), transparent 70%);
    padding: 2rem;
}

.card-stack {
    position: relative;
    width: 85%;
    max-width: 360px;
    aspect-ratio: 3/4;
    margin: 0 auto 1rem;
    perspective: 1200px;
}

    .card-stack .card {
        position: absolute;
        inset: 0;
        background: linear-gradient(145deg, #2b2b2b, #1a1a1a);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.6), inset 0 0 8px rgba(255,255,255,0.03);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
        transform-style: preserve-3d;
        transition: box-shadow 0.3s ease;
    }

        .card-stack .card:hover {
            transform: translateY(-10px) scale(1.04);
            box-shadow: 0 8px 20px rgba(0,0,0,0.7), inset 0 0 12px rgba(255,255,255,0.05);
        }

        .card-stack .card:nth-child(1) {
            z-index: 1;
            transform: translate(0,0) rotate(0deg);
        }

        .card-stack .card:nth-child(2) {
            z-index: 2;
            transform: translate(0,12px) rotate(-2deg);
        }

        .card-stack .card:nth-child(3) {
            z-index: 3;
            transform: translate(0,24px) rotate(-4deg);
        }

.task-title {
    font-size: 1.6rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.6rem;
    backface-visibility: hidden;
}

.task-description {
    font-size: 1rem;
    color: #ddd;
    text-align: center;
    line-height: 1.4;
    backface-visibility: hidden;
}

.small-button {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 1.2rem 2rem;
    font-size: 2rem;
    border-radius: 20px;
    letter-spacing: 1px;
    text-transform: none;
    transition: transform 0.15s ease, filter 0.3s ease;
}

    .small-button:hover {
        transform: scale(1.05);
        filter: brightness(1.1);
    }

@keyframes flipToFront {
    0% {
        transform: rotateY(180deg) translateY(24px) rotate(-4deg);
        box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    }

    100% {
        transform: rotateY(0deg) translateY(0) rotate(0deg);
        box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    }
}

@keyframes flipToBack {
    0% {
        transform: rotateY(0deg) translateY(0) rotate(0deg);
        box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    }

    100% {
        transform: rotateY(180deg) translateY(24px) rotate(-4deg);
        box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    }
}

.card.drawn {
    animation: flipToFront 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
    transform-origin: bottom center;
}

.card.returning {
    animation: flipToBack 0.7s cubic-bezier(0.4,0,0.2,1) forwards;
    transform-origin: bottom center;
}

.card.branded {
    transform: rotateY(180deg) translateY(24px) rotate(-4deg);
    backface-visibility: hidden;
}

    .card.branded .brand-text {
        font-family: inherit;
        font-weight: bold;
        font-size: 2rem;
        text-transform: none;
        color: white;
        opacity: 0.8;
        transform: rotate(-15deg);
        position: relative;
        top: 10px;
        backface-visibility: hidden;
    }

.button-action {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #666666, #444444);
    border: none;
    border-radius: 30px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.3s ease;
}

    .button-action:hover {
        transform: scale(1.05);
        filter: brightness(1.1);
    }

    .button-action:active {
        transform: scale(0.95);
        filter: brightness(0.9);
    }

    .button-action .color-box {
        width: 12px;
        height: 12px;
        border-radius: 3px;
        margin-right: 0.5rem;
        background: #00c851;
    }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

@media screen and (max-width: 768px) {
    .title {
        font-size: 3.5rem;
    }

    .subtitle {
        font-size: 1.6rem;
    }

    .button-primary, .button-secondary {
        font-size: 1.6rem;
        padding: 2rem;
    }

    .card-stack {
        max-width: 300px;
    }

    .small-button {
        padding: 1rem 1.5rem;
        font-size: 1.8rem;
    }
}

@media screen and (max-width: 480px) {
    .title {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 1.4rem;
    }

    .button-primary, .button-secondary {
        font-size: 1.4rem;
        padding: 1.5rem;
    }

    .card-stack {
        max-width: 250px;
    }

    .small-button {
        padding: 0.8rem 1.2rem;
        font-size: 1.6rem;
    }
}

@keyframes shuffleCards {
    0% {
        transform: translate(0,0) rotate(0deg);
        opacity: 1;
    }

    20% {
        transform: translate(-8px,6px) rotate(-3deg);
    }

    40% {
        transform: translate(6px,-8px) rotate(4deg);
    }

    60% {
        transform: translate(-6px,8px) rotate(-2deg);
    }

    80% {
        transform: translate(8px,-4px) rotate(2deg);
    }

    100% {
        transform: translate(0,0) rotate(0deg);
        opacity: 1;
    }
}

.card-stack.shuffle .card:nth-child(1) {
    animation: shuffleCards 3s ease-in-out infinite;
}

.card-stack.shuffle .card:nth-child(2) {
    animation: shuffleCards 3s ease-in-out infinite 0.5s;
}

.card-stack.shuffle .card:nth-child(3) {
    animation: shuffleCards 3s ease-in-out infinite 1s;
}

.card-stack-container .card-stack {
    width: clamp(120px,30vw,300px) !important;
    max-width: 300px;
    aspect-ratio: 3/4;
    margin-top: 3rem;
    margin-left: auto;
    margin-right: auto;
}

@media screen and (min-width: 768px) {
    .card-stack-container .card-stack {
        width: clamp(150px,25vw,350px) !important;
        max-width: 350px;
    }
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1 1 0;
    padding: 0 0.5rem;
}

@media (max-width: 600px) {
    .col {
        flex: 1 1 100%;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .col-2 {
        flex: 1 1 50%;
    }
}

@media (min-width: 1025px) {
    .col-3 {
        flex: 1 1 33.3333%;
    }
}

img, picture, video {
    max-width: 100%;
    height: auto;
    display: block;
}

html {
    font-size: clamp(14px,1.2vw,18px);
}

h1 {
    font-size: clamp(2rem,5vw,5rem);
}

h2 {
    font-size: clamp(1.75rem,4.5vw,4rem);
}

h3 {
    font-size: clamp(1.5rem,4vw,3rem);
}

.button-primary,
.button-secondary,
.button-action,
.lobby-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .button-container,
    .game-overlay .button-container {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

body, .layout-root, .app-content {
    overflow-x: hidden;
}

.button-action {
    width: auto !important;
    max-width: 100%;
    box-sizing: border-box;
    display: inline-flex !important;
}

.button-container,
.game-overlay .button-container {
    text-align: center;
}

@media (max-width: 400px) {
    .button-action {
        max-width: 100%;
    }
}

.game-overlay .button-container {
    display: flex;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    justify-content: center;
    gap: 1rem;
}

.small-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.game-button-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

    .game-button-group button {
        flex-shrink: 1;
        min-width: clamp(120px,25%,300px);
        white-space: nowrap;
        font-size: clamp(1rem,3vw,1.8rem);
        padding-block: clamp(0.8rem,2vh,1.5rem);
        padding-inline: clamp(2rem,6vw,4rem);
        border-radius: clamp(16px,2vw,32px);
    }

.brand-logo {
    width: clamp(160px,30%,240px);
    height: auto;
    display: block;
    margin: 0 auto;
}
