/*
 * Copyright (c) Sega Corporation. All rights reserved.
 *
 * This stylesheet and its source code are the exclusive property of Sega Corporation
 * and may not be copied, modified, distributed, or used without prior written permission
 * from Sega Corporation.
 */

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    touch-action: none;
    text-align: center;
    background: #ffffff;
    font-family: "Helvetica Neue", "Helvetica", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", "Yu Gothic", "Meiryo", sans-serif;
}

.wrapper-scale-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    /*border: #ff0000 2px solid;*/
}

.stage-bg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    /* ensure it's behind game and logos */
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 800px auto;
    /* tile size */
    background-position: left;
    opacity: 0.2;
    pointer-events: none;
    /* allow clicks to pass through */
}

.wrapper-scaled {
    transform: scale(1);
    transform-origin: top center;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-left: 1px solid rgb(0, 0, 0);
    border-right: 1px solid rgb(0, 0, 0);
    background: #ffffff;
    /*border: #d9ff00 2px solid;*/
}

.logo-container {
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border-right: #000 1px solid;
    border-left: #000 1px solid;
    border-top: #000 1px solid;
}

.logo-container-row {
    display: flex;
    flex-direction: row;
    width: 90%;
    height: 50%;
    align-items: center;
    gap: 5%;
}

.logo-container-row a {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80%;
}

.logo-container-row img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    display: block;
    /*border: #000 1px solid;*/
}

/* Top row: align items to bottom */
.logo-container-row.top {
    align-items: flex-end;
}

/* Bottom row: align items to top */
.logo-container-row.bottom {
    align-items: flex-start;
}

.game-wrapper {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    width: 100%;
}

.next {
    margin-left: -3px;
    position: relative;
    width: 150px;
    height: 200px;
    flex-shrink: 0;
    background-image: url("https://d21bvhnv5sqigo.cloudfront.net/next-en1.png");
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    /* top gap */
    align-self: flex-start;
    margin-top: 50px;
    /*border: #0026ff 2px solid;*/
}

.next-puyo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    margin-bottom: 12%;
    margin-top: -4%;
}

.nextpuyo {
    width: 40px;
    height: 40px;
    margin: 12px 0;
    margin-left: -150%;
    /* Space between the two */
    display: block;
}

.vertical-next-logo {
    position: absolute;
    top: 420px;
    transform: rotate(90deg);
    height: 100px;
    object-fit: contain;
    pointer-events: none;
}

.game-content {
    width: 400px;
    height: 850px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-right: 1px solid rgb(61, 61, 61);
}

#stage {
    flex-grow: 1;
    width: 100%;
    height: 800px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

#stage>*:not(.stage-bg):not(.leaderboard-popup) {
    position: relative;
}

#stage * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Proportional vertical layout */
.loginform {
    flex: 0 0 40%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.hidden {
    display: none !important;
}

#start-div {
    flex: 0 0 25%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#instructions {
    flex: 0 0 auto;
    width: 90%;
    padding: 15px;
    border: 2px solid #8418ff;
    background-color: #ffffff;
    box-sizing: border-box;
}

#score {
    height: 50px;
    overflow: hidden;
    border-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#gameover {
    position: relative;
    top: 40%;

    display: none;
    width: 250px;
    background-color: rgba(0, 0, 0, 0);
    cursor: pointer;
    z-index: 10;
    text-align: center;
}

.Score-happyou {
    background-color: rgba(255, 255, 255, 1);
    font-weight: bold;
    font-size: large;
    z-index: 11;
    position: relative;
    padding: 20px;
    border: #000 3px solid;
}

.space {
    background-color: rgba(255, 255, 255, 0.5);
    display: inline-block;
}

.p-label {
    font-weight: bold;
    font-size: large;
    width: 100%;
    display: block;
    margin-top: 20px;
    padding: 0;
}

.input-login {
    width: 60%;
    height: 80%;
    margin-top: 8px;
    box-sizing: border-box;
}

#button:active {
    background-image: none;
}

.horizontal-center {
    left: 50%;
    transform: translateX(-50%);
}


/* Game elements */
#puyocross {
    opacity: 0;
    pointer-events: none;
}

#chain-display {
    position: absolute;
    display: none;
    pointer-events: none;
    z-index: 5;
}

/* UI elements */
/* Loading spinner */
.login-loading {
    display: none;
    margin-top: 10px;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 10;

    /* Prevent layout shift */
    min-width: 40px;
    min-height: 40px;
}

.spinner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Copyright */
.copyright {
    position: absolute;
    top: 780px;
    bottom: 0;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    padding-bottom: 4px;
}

/* instructions and controls */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    margin-top: 8px;
}

.control {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.control img.arrow {
    object-fit: contain;
}

.control .label {
    margin-top: 4px;
    font-size: small;
}

.control-label {
    font-weight: bold;
    font-size: large;
    text-align: center;
    margin-bottom: 8px;
}

.instructions-table {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 12px auto;
    border-collapse: collapse;
    border: 1px solid #444444;
}

.instructions-table td {
    padding: 6px 10px;
    vertical-align: top;
    font-size: 14px;
    border: 1px solid #444444;
}

.instructions-table .label-heading {
    font-weight: bold;
    white-space: nowrap;
    text-align: right;
    background-color: #f5f5f5;
    border-right: 1px solid #444444;
}

.startbutton {
    width: 350px;
    height: 100%;

    background-image: url("https://d21bvhnv5sqigo.cloudfront.net/start-en1.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    border: none;
    background-color: transparent;
    cursor: pointer;

    display: block;
    /* ensure it's not inline */
}

.startbutton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}