/* ゲーム画面のレイアウト */
.game-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
    min-width: 70px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.score-info h3 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.score-info .value {
    font-size: 1.5em;
    font-weight: bold;
    color: #4ecdc4;
}

.next-block-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    min-width: 70px;
}

.next-block-container h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.next-block-preview {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.next-block-preview .mini-block {
    width: 12px;
    height: 12px;
    position: absolute;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.game-board-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.game-board {
    width: 240px;
    height: 480px;
    background: rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

.grid-highlight {
    position: absolute;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    transition: opacity 0.2s;
}

.danger-line {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff4444, #ff6666, #ff4444);
    box-shadow: 0 0 10px #ff4444;
    z-index: 10;
    animation: dangerPulse 2s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.danger-line::before {
    content: "DANGER";
    position: absolute;
    right: 5px;
    top: -10px;
    font-size: 8px;
    color: #ff4444;
    font-weight: bold;
}

/* ブロック操作ボタン */
.controls {
    text-align: center;
    margin-top: 15px;
}

/* 画面下部の操作説明 */
.instructions {
    text-align: center;
    margin-top: 10px;
    font-size: 0.8em;
    opacity: 0.8;
    line-height: 1.4;
}

.audio-controls {
    display: flex;
    gap: 8px;
    position: static;
    left: unset;
    top: unset;
    transform: none;
    z-index: auto;
    margin-top: 10px; /* 上部マージンを追加 */
    margin-bottom: 10px; /* 下部マージンを追加 */
}
.audio-controls.vertical {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 15px;
}
.audio-btn {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9em;
    padding: 5px 10px;
    cursor: pointer;
    transition: background 0.2s;
}
.audio-btn.active {
    background: rgba(150, 150, 150, 0.8);
    color: #333;
    border-color: rgba(150, 150, 150, 0.8);
}

/* 音がONの状態（通常状態）では緑色 */
.audio-btn:not(.active) {
    background: #4ecdc4;
    color: #222;
    border-color: #4ecdc4;
}

/* ===================================
   ヘッダー認証状態表示
   =================================== */

/* ヘッダー右側のコントロール */
.header-right-controls {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right-controls .audio-controls {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.header-right-controls .audio-btn {
    background: #4ecdc4; /* デフォルト（音ON）は緑色 */
    border: 1px solid #4ecdc4;
    border-radius: 15px;
    color: #222;
    font-size: 0.75em;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.header-right-controls .audio-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-right-controls .audio-btn.active {
    background: rgba(150, 150, 150, 0.8); /* 音OFF（ミュート）は灰色 */
    color: #333;
    border-color: rgba(150, 150, 150, 0.8);
}

.header-right-controls .pause-btn {
    position: static;
    transform: none;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.header-right-controls .pause-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* ヘッダー認証状態の基本コンテナ */
.header-auth-status {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    z-index: 10;
}

/* ログイン済みユーザー表示 */
.header-auth-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px; /* パディングを少し増やす */
    border-radius: 25px; /* より丸くする */
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.header-username {
    color: #4ecdc4;
    font-size: 0.9em;
    font-weight: bold;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-auth-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8em;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s, transform 0.1s;
}

.header-auth-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* ゲスト状態の表示 */
.header-auth-guest {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.header-guest-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85em;
    font-weight: 500;
}

/* 認証済みユーザー状態の表示 */
.header-auth-status-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8em;
    margin-left: 5px;
}