:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --accent-cyan: #00f5ff;
    --accent-magenta: #ff00aa;
    --accent-gold: #ffd700;
    --accent-purple: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --grid-line: rgba(255, 255, 255, 0.08);
    --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.5);
    --glow-magenta: 0 0 20px rgba(255, 0, 170, 0.5);

    /* テトリミノカラー */
    --piece-I: #00f5ff;
    --piece-O: #ffd700;
    --piece-T: #8b5cf6;
    --piece-S: #00ff88;
    --piece-Z: #ff4757;
    --piece-J: #3b82f6;
    --piece-L: #ff8c00;
    --piece-ghost: rgba(255, 255, 255, 0.15);
    --piece-garbage: #4a4a5a;

    /* スマホ縦画面用ネオンカラー */
    --neon-cyan: #00FFFF;
    --neon-magenta: #FF00FF;
    --neon-yellow: #FFFF00;
    --neon-orange: #FFD700;
    --bg-dark: #0f0f23;
    --bg-board: #1a1a2e;
    --bg-button: rgba(0, 0, 0, 0.6);
    --glow-cyan-strong: 0 0 10px #00FFFF, 0 0 20px #00FFFF;
    --glow-magenta-strong: 0 0 10px #FF00FF, 0 0 20px #FF00FF;
    --glow-yellow: 0 0 10px #FFFF00, 0 0 15px #FFFF00;
    --font-gaming: 'Orbitron', 'Press Start 2P', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* 背景エフェクト */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-effects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 0, 170, 0.1) 0%, transparent 50%);
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px);
    animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(4px);
    }
}

/* メインコンテナ */
.game-container {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ヘッダー */
.header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--grid-line);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: var(--glow-cyan);
}

.match-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.timer {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ゲームエリア - PC版 */
.game-area {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    align-items: center;
    justify-items: center;
    overflow: hidden;
    min-height: 0;
}

/* プレイヤーセクション */
.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.player-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-section.player .player-name {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(0, 245, 255, 0.05));
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: var(--glow-cyan);
}

.player-section.opponent .player-name {
    background: linear-gradient(135deg, rgba(255, 0, 170, 0.2), rgba(255, 0, 170, 0.05));
    border: 1px solid var(--accent-magenta);
    color: var(--accent-magenta);
    box-shadow: var(--glow-magenta);
}

.game-board-wrapper {
    position: relative;
    display: flex;
    gap: 0.75rem;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-box {
    background: var(--bg-secondary);
    border: 1px solid var(--grid-line);
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 100px;
}

.panel-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    aspect-ratio: 4/4;
}

.preview-cell {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    color: var(--accent-gold);
}

/* ゲームボード */
.game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 1px;
    background: var(--bg-secondary);
    border: 2px solid var(--grid-line);
    border-radius: 8px;
    padding: 4px;
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 0, 0, 0.3);
}

.player .game-board {
    width: min(280px, calc(50vh - 100px));
    border-color: rgba(0, 245, 255, 0.3);
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 245, 255, 0.1);
}

.opponent .game-board {
    width: min(280px, calc(50vh - 100px));
    border-color: rgba(255, 0, 170, 0.3);
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 0, 170, 0.1);
}

/* アテナ様の顔アイコン */
.athena-face-container {
    position: relative;
    width: min(100px, 12vh);
    height: min(100px, 12vh);
    margin-bottom: 0.5rem;
}

.athena-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: 3px solid var(--accent-magenta);
    box-shadow:
        var(--glow-magenta),
        inset 0 0 20px rgba(255, 0, 170, 0.2);
    object-fit: cover;
    position: relative;
    z-index: 2;
}

.athena-face-glow {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 0, 170, 0.4) 0%, transparent 70%);
    z-index: 1;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.athena-status {
    font-size: 0.8rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    min-height: 1.2em;
    text-align: center;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.cell {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: 2px;
    transition: all 0.05s ease;
}

.cell.filled {
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.cell.I {
    background: var(--piece-I);
}

.cell.O {
    background: var(--piece-O);
}

.cell.T {
    background: var(--piece-T);
}

.cell.S {
    background: var(--piece-S);
}

.cell.Z {
    background: var(--piece-Z);
}

.cell.J {
    background: var(--piece-J);
}

.cell.L {
    background: var(--piece-L);
}

.cell.ghost {
    background: var(--piece-ghost);
    border: 1px dashed rgba(255, 255, 255, 0.3);
}

.cell.garbage {
    background: var(--piece-garbage);
}

.cell.clearing {
    animation: clearLine 0.3s ease-out;
}

@keyframes clearLine {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
        background: white;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* 中央パネル */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem;
    max-height: 100%;
    overflow: hidden;
}

.vs-badge {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.attack-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.attack-bar {
    width: 20px;
    height: min(120px, 15vh);
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.attack-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, var(--accent-magenta), var(--accent-cyan));
    transition: height 0.3s ease;
    border-radius: 10px;
}

.attack-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* スコアボード */
.scoreboard {
    background: var(--bg-secondary);
    border: 1px solid var(--grid-line);
    border-radius: 8px;
    padding: 1rem;
    min-width: 120px;
}

.score-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--grid-line);
}

.score-row:last-child {
    border-bottom: none;
}

.score-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.score-value {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
}

.score-value.player-score {
    color: var(--accent-cyan);
}

.score-value.opponent-score {
    color: var(--accent-magenta);
}

/* コントロール */
.controls-area {
    display: none;
    padding: 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--grid-line);
}

.touch-controls {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.touch-btn {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--grid-line);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.touch-btn:active {
    transform: scale(0.95);
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.touch-btn.rotate {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.1));
    border-color: var(--accent-purple);
}

.touch-btn.drop {
    background: linear-gradient(135deg, rgba(255, 0, 170, 0.3), rgba(255, 0, 170, 0.1));
    border-color: var(--accent-magenta);
}

/* オーバーレイ */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.game-overlay.hidden {
    display: none;
}

.overlay-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.overlay-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
}

.start-btn {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
    border: none;
    border-radius: 8px;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.3);
}

.controls-hint {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    max-width: 400px;
}

.controls-hint h3 {
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    text-align: center;
}

.key-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}

.key {
    font-family: 'Orbitron', monospace;
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* 勝敗画面 */
.result-screen {
    text-align: center;
}

.result-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.result-title.win {
    color: var(--accent-cyan);
    text-shadow: var(--glow-cyan);
}

.result-title.lose {
    color: var(--accent-magenta);
    text-shadow: var(--glow-magenta);
}

.result-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.result-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* より大きな画面用 */
@media (min-width: 1400px) and (min-height: 900px) {

    .player .game-board,
    .opponent .game-board {
        width: min(340px, calc(50vh - 80px));
    }

    .athena-face-container {
        width: 120px;
        height: 120px;
    }

    .panel-box {
        min-width: 100px;
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }


    .mobile-top-bar {
        gap: 0.5rem;
    }
}

/* PC版では非表示 */
@media (min-width: 901px) {
    .mobile-top-bar {
        display: none;
    }
}

/* アニメーション */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease;
}

@keyframes flashAttack {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

.flash-attack {
    animation: flashAttack 0.2s ease 3;
}

/* =========================================
   Mobile & Responsive Adjustments
   ========================================= */

/* Mobile Header Stats (Hidden on Desktop) */
.mobile-header-stats {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(18, 18, 26, 0.8);
    border: 1px solid var(--grid-line);
    border-radius: 8px;
}

.mobile-stat-col {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mobile-name {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.player-col .mobile-name {
    color: var(--accent-cyan);
}

.opponent-col .mobile-name {
    color: var(--accent-magenta);
}

.mobile-stat-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.mobile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mobile-stat-item .label {
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.mini-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    width: 40px;
    height: 40px;
}

.mini-preview .preview-cell {
    width: 100%;
    height: 100%;
}

.mobile-stat-text {
    font-size: 0.75rem;
    font-family: 'Orbitron', monospace;
    color: var(--text-secondary);
}

.mobile-stat-text span {
    color: var(--text-primary);
    font-weight: bold;
}

/* Responsive Behaviors */

@media (min-width: 901px) {
    .mobile-header-stats {
        display: none;
    }

    .desktop-only {
        display: block;
    }
}

@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .game-area {
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .player-section.opponent {
        display: none;
    }

    .player-section.player {
        width: 100%;
        max-width: 350px;
    }

    .game-board-wrapper {
        justify-content: center;
    }

    .controls-area {
        display: block;
        padding-bottom: 2rem;
    }

    .touch-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* =========================================
   スマホ縦画面専用 ネオンサイバーパンクUI
   ========================================= */

@media screen and (max-width: 768px) and (orientation: portrait) {
    /* 全体背景 */
    body {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #2d1b4e 100%);
    }

    .bg-effects::before {
        background:
            radial-gradient(ellipse at 20% 20%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 80% 80%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
    }

    /* ゲームコンテナ */
    .game-container {
        background: transparent;
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    /* ヘッダー非表示（スマホ版ヘッダーを使用） */
    .header {
        display: none;
    }

    /* ゲームエリア */
    .game-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0;
        gap: 0;
        min-height: 0;
        overflow: hidden;
    }

    /* PC版セクションを非表示 */
    .player-section.player,
    .player-section.opponent,
    .center-panel {
        display: none !important;
    }

    /* =========================================
       モバイルヘッダー統計エリア (約10%)
       ========================================= */
    .mobile-header-stats {
        display: flex !important;
        justify-content: space-between;
        align-items: stretch;
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
        min-height: 70px;
    }

    .mobile-stat-col {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
    }

    .mobile-stat-col.player-col {
        align-items: flex-start;
    }

    .mobile-stat-col.opponent-col {
        align-items: flex-end;
    }

    .mobile-name {
        font-family: var(--font-gaming);
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 2px;
        text-transform: uppercase;
    }

    .player-col .mobile-name {
        color: var(--neon-cyan);
        text-shadow: var(--glow-cyan-strong);
    }

    .opponent-col .mobile-name {
        color: var(--neon-orange);
        text-shadow: 0 0 10px var(--neon-orange);
    }

    .mobile-stat-row {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .mobile-stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .mobile-stat-item .label {
        font-size: 0.55rem;
        color: var(--text-secondary);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .mini-preview {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1px;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(0, 255, 255, 0.3);
        border-radius: 4px;
        padding: 2px;
    }

    .mini-preview.hold-preview {
        border-color: rgba(255, 0, 255, 0.3);
    }

    .mini-preview .preview-cell {
        width: 100%;
        height: 100%;
        background: var(--bg-tertiary);
        border-radius: 1px;
    }

    .mini-preview .preview-cell.filled {
        box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.3);
    }

    .mobile-stat-text {
        font-family: var(--font-gaming);
        font-size: 0.65rem;
        color: var(--text-secondary);
        line-height: 1.4;
    }

    .mobile-stat-text span {
        color: var(--text-primary);
        font-weight: 700;
    }

    /* アテナアイコン */
    .mobile-athena-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        overflow: hidden;
        border: 2px solid var(--neon-magenta);
        box-shadow: var(--glow-magenta-strong);
        flex-shrink: 0;
    }

    .mobile-athena-icon img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* =========================================
       モバイルボードコンテナ (約65%)
       ========================================= */
    .mobile-boards-container {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex: 1;
        padding: 6px 8px;
        min-height: 0;
        overflow: hidden;
    }

    .mobile-board-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        height: 100%;
        max-height: calc(65vh - 20px);
    }

    .mobile-board-label {
        font-family: var(--font-gaming);
        font-size: 0.6rem;
        font-weight: 700;
        letter-spacing: 2px;
        text-transform: uppercase;
        padding: 3px 10px;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .mobile-board-label.player-label {
        color: var(--neon-cyan);
        background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 255, 0.05));
        border: 1px solid var(--neon-cyan);
        box-shadow: var(--glow-cyan-strong);
        text-shadow: var(--glow-cyan-strong);
    }

    .mobile-board-label.opponent-label {
        color: var(--neon-magenta);
        background: linear-gradient(135deg, rgba(255, 0, 255, 0.2), rgba(255, 0, 255, 0.05));
        border: 1px solid var(--neon-magenta);
        box-shadow: var(--glow-magenta-strong);
        text-shadow: var(--glow-magenta-strong);
    }

    .mobile-game-board {
        display: grid;
        grid-template-columns: repeat(10, 1fr);
        gap: 1px;
        background: var(--bg-board);
        border-radius: 6px;
        padding: 3px;
        width: calc(44vw - 10px);
        max-width: 150px;
        height: calc(100% - 24px);
        max-height: calc((44vw - 10px) * 2);
    }

    .player-board-wrapper .mobile-game-board {
        border: 2px solid var(--neon-cyan);
        box-shadow:
            var(--glow-cyan-strong),
            inset 0 0 20px rgba(0, 255, 255, 0.1);
    }

    .opponent-board-wrapper .mobile-game-board {
        border: 2px solid var(--neon-magenta);
        box-shadow:
            var(--glow-magenta-strong),
            inset 0 0 20px rgba(255, 0, 255, 0.1);
    }

    /* グリッド線 */
    .mobile-game-board .cell {
        aspect-ratio: 1;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 1px;
        transition: all 0.05s ease;
    }

    /* テトリミノにグロー効果追加 */
    .mobile-game-board .cell.filled {
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow:
            inset 0 0 5px rgba(255, 255, 255, 0.2),
            0 0 4px currentColor;
    }

    /* テトリミノカラー */
    .mobile-game-board .cell.I {
        background: var(--neon-cyan);
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px var(--neon-cyan);
    }

    .mobile-game-board .cell.O {
        background: var(--neon-yellow);
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px var(--neon-yellow);
    }

    .mobile-game-board .cell.T {
        background: #9B59B6;
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px #9B59B6;
    }

    .mobile-game-board .cell.S {
        background: #00FF00;
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px #00FF00;
    }

    .mobile-game-board .cell.Z {
        background: #FF0000;
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px #FF0000;
    }

    .mobile-game-board .cell.J {
        background: #0000FF;
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px #0000FF;
    }

    .mobile-game-board .cell.L {
        background: #FFA500;
        box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.3), 0 0 6px #FFA500;
    }

    .mobile-game-board .cell.ghost {
        background: var(--piece-ghost);
        border: 1px dashed rgba(255, 255, 255, 0.3);
        box-shadow: none;
    }

    .mobile-game-board .cell.garbage {
        background: var(--piece-garbage);
        box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
    }

    .mobile-game-board .cell.clearing {
        animation: clearLine 0.3s ease-out;
    }

    /* =========================================
       コントロールエリア (約25%)
       ========================================= */
    .controls-area {
        display: block !important;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px 16px 20px;
        flex-shrink: 0;
    }

    .touch-controls {
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 380px;
        margin: 0 auto;
        position: relative;
    }

    .control-row {
        display: flex;
        justify-content: center;
        gap: 12px;
    }

    /* ネオンボタン基本スタイル */
    .touch-btn.neon-btn {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        background: var(--bg-button);
        border: 2px solid;
        border-radius: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.1s ease;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        position: relative;
        overflow: hidden;
    }

    .touch-btn.neon-btn .btn-icon {
        font-size: 1.4rem;
        line-height: 1;
    }

    .touch-btn.neon-btn .btn-label {
        font-family: var(--font-gaming);
        font-size: 0.5rem;
        letter-spacing: 1px;
        margin-top: 2px;
    }

    /* 移動ボタン (シアン) */
    .touch-btn.move-btn {
        border-color: var(--neon-cyan);
        color: var(--neon-cyan);
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    }

    .touch-btn.move-btn:active {
        transform: scale(0.95);
        background: rgba(0, 255, 255, 0.2);
        box-shadow:
            0 0 20px var(--neon-cyan),
            inset 0 0 10px rgba(0, 255, 255, 0.3);
    }

    /* 回転ボタン (シアン) */
    .touch-btn.rotate-btn {
        border-color: var(--neon-cyan);
        color: var(--neon-cyan);
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    }

    .touch-btn.rotate-btn:active {
        transform: scale(0.95);
        background: rgba(0, 255, 255, 0.2);
        box-shadow:
            0 0 20px var(--neon-cyan),
            inset 0 0 10px rgba(0, 255, 255, 0.3);
    }

    /* ソフトドロップボタン (黄色) */
    .touch-btn.softdrop-btn {
        border-color: var(--neon-yellow);
        color: var(--neon-yellow);
        box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
    }

    .touch-btn.softdrop-btn:active {
        transform: scale(0.95);
        background: rgba(255, 255, 0, 0.2);
        box-shadow:
            0 0 20px var(--neon-yellow),
            inset 0 0 10px rgba(255, 255, 0, 0.3);
    }

    /* ハードドロップボタン (マゼンタ) */
    .touch-btn.harddrop-btn {
        width: 70px;
        border-color: var(--neon-magenta);
        color: var(--neon-magenta);
        box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
    }

    .touch-btn.harddrop-btn:active {
        transform: scale(0.95);
        background: rgba(255, 0, 255, 0.2);
        box-shadow:
            0 0 20px var(--neon-magenta),
            inset 0 0 10px rgba(255, 0, 255, 0.3);
    }

    /* ホールドボタン (マゼンタ) */
    .touch-btn.hold-btn {
        border-color: var(--neon-magenta);
        color: var(--neon-magenta);
        box-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
    }

    .touch-btn.hold-btn:active {
        transform: scale(0.95);
        background: rgba(255, 0, 255, 0.2);
        box-shadow:
            0 0 20px var(--neon-magenta),
            inset 0 0 10px rgba(255, 0, 255, 0.3);
    }

    /* ポーズボタン */
    .touch-btn.pause-btn {
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-color: rgba(255, 255, 255, 0.3);
        color: rgba(255, 255, 255, 0.5);
        box-shadow: none;
    }

    .touch-btn.pause-btn .btn-icon {
        font-size: 1rem;
    }

    .touch-btn.pause-btn:active {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }

    /* =========================================
       オーバーレイ画面のスマホ対応
       ========================================= */
    .game-overlay {
        background: linear-gradient(135deg, rgba(15, 15, 35, 0.98), rgba(45, 27, 78, 0.98));
    }

    .overlay-title {
        font-size: 2rem;
    }

    .overlay-subtitle {
        font-size: 1rem;
    }

    .start-btn {
        font-size: 1rem;
        padding: 0.8rem 2rem;
    }

    .controls-hint {
        display: none;
    }

    .result-title {
        font-size: 2.5rem;
    }

    .result-stats {
        gap: 1.5rem;
    }

    .result-stat-value {
        font-size: 1.5rem;
    }

    /* モバイル専用要素のデフォルト非表示解除 */
    .mobile-boards-container {
        display: flex !important;
    }
}

/* 横画面時はモバイル専用要素を非表示 */
@media screen and (orientation: landscape) {
    .mobile-boards-container {
        display: none !important;
    }
}

/* PC/タブレット横画面ではモバイル専用要素を非表示 */
@media screen and (min-width: 769px) {
    .mobile-boards-container {
        display: none !important;
    }

    .mobile-athena-icon {
        display: none !important;
    }
}