/* ซ่อน step ที่ 2+ ด้วย CSS ป้องกัน FOUC ก่อน JS โหลด */
.gp-create ~ .gp-create {
    display: none;
}

/* ปุ่ม Back */
.gp-create__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 0.9rem;
    padding: 0 0 12px 0;
    margin: 0;
    opacity: 0.75;
}
.gp-create__back:hover {
    opacity: 1;
}

/* Test Login Form (STEP 0) */
.lr-test-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lr-test-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lr-test-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lr-test-form__label {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
}

.lr-test-form__input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 7px;
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.15s;
}

.lr-test-form__input:focus {
    border-color: rgba(255, 255, 255, 0.6);
}

.lr-test-form__input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.lr-test-form__btn {
    align-self: flex-start;
    background: #5b6af0;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.15s;
}

.lr-test-form__btn:hover {
    opacity: 0.87;
}

@media (max-width: 480px) {
    .lr-test-form__row {
        grid-template-columns: 1fr;
    }
}

/* STEP 3: Loading game data */
.gp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 48px 0;
    animation: gp-fadein 0.35s ease both;
}

@keyframes gp-fadein {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Double-ring spinner */
.gp-loading__spinner {
    position: relative;
    width: 64px;
    height: 64px;
}

.gp-loading__spinner::before,
.gp-loading__spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
}

.gp-loading__spinner::before {
    border-top-color: #fff;
    animation: gp-spin 0.85s linear infinite;
}

.gp-loading__spinner::after {
    inset: 10px;
    border-top-color: rgba(255, 255, 255, 0.35);
    animation: gp-spin 1.3s linear infinite reverse;
}

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

/* Text */
.gp-loading__text {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

/* Animated dots */
.gp-loading__dots::after {
    content: '';
    animation: gp-dots 1.2s steps(4, end) infinite;
}

@keyframes gp-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
}

/* Progress bar */
.gp-loading__bar-wrap {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.gp-loading__bar {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0;
}

.gp-loading__bar--run {
    animation: gp-progress 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes gp-progress {
    0%   { width: 0%; }
    60%  { width: 72%; }
    90%  { width: 88%; }
    100% { width: 95%; }
}
