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

/* iOS ダブルタップズーム防止 */
html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #0f172a;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(1px 1px at 33% 85%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 75% 40%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 15% 65%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(2px 2px at 45% 15%, rgba(255, 255, 255, 0.25), transparent),
        radial-gradient(1px 1px at 95% 85%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 25% 45%, rgba(255, 255, 255, 0.15), transparent),
        radial-gradient(2px 2px at 70% 90%, rgba(255, 255, 255, 0.25), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    color: #fff;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 10px;
    overflow-y: auto;
    position: relative;
}

/* 星座風背景 */
.stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.constellation-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(100, 200, 255, 0) 0%, 
        rgba(100, 200, 255, 0.3) 50%, 
        rgba(100, 200, 255, 0) 100%);
    transform-origin: left center;
}

.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.5);
    animation: shoot 3s linear infinite;
    opacity: 0;
}

@keyframes shoot {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translateX(300px) translateY(300px);
    }
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

h1 {
    font-size: 40px;
    color: #00ffff;
    text-align: center;
    letter-spacing: 8px;
}

.action-display {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-text {
    font-size: 20px;
    font-weight: bold;
    color: #ffff00;
    background-color: rgba(128, 0, 128, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.game-area {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#gameCanvas {
    border: 3px solid #475569;
    background-color: #1e293b;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
}

.panel-section {
    background-color: rgba(30, 41, 59, 0.4);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.panel-section h3 {
    font-size: 14px;
    color: #fff;
    margin-bottom: 10px;
    text-align: center;
}

#nextCanvas {
    display: block;
    margin: 0 auto;
    background-color: rgba(128, 128, 128, 0.2);
    border-radius: 8px;
}

.score-display {
    text-align: center;
}

.score-label {
    font-size: 14px;
    color: #fff;
    margin-bottom: 5px;
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    color: #00ffff;
}

.level-value {
    color: #ffff00;
}

.controls-info {
    font-size: 10px;
    line-height: 1.6;
    color: #ccc;
}

.controls-info h4 {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
    text-align: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.button-group button {
    flex: 1;
}

/* 操作切り替えトグル */
#controlTogglePanel {
    padding: 10px;
}

#controlTogglePanel h3 {
    font-size: 12px;
    margin-bottom: 8px;
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #00ffff;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-text {
    font-size: 12px;
    color: #aaa;
}

/* スワイプ操作説明 */
.swipe-instructions {
    margin-top: 10px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 6px;
    font-size: 10px;
    color: #888;
    line-height: 1.6;
}

.swipe-instructions.hidden {
    display: none;
}

.swipe-title {
    color: #aaa;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 11px;
}

/* ボタン操作パネル */
.button-controls {
    position: fixed;
    bottom: 20px;
    right: 30px;
    display: flex;
    justify-content: flex-end;
    z-index: 100;
    pointer-events: none;
}

.dpad-container {
    pointer-events: auto;
}

/* 十字キー */
.dpad {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dpad-row {
    display: flex;
    gap: 0;
}

.dpad-btn {
    width: 50px;
    height: 50px;
    background: rgba(58, 58, 58, 0.35);
    border: 2px solid rgba(120, 120, 120, 0.8);
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* iOS連打対策 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active {
    background: rgba(80, 80, 80, 0.6);
    transform: scale(0.95);
}

.dpad-empty {
    width: 50px;
    height: 50px;
}

.dpad-center {
    width: 50px;
    height: 50px;
    background: rgba(26, 26, 26, 0.35);
    border: 2px solid rgba(120, 120, 120, 0.8);
    border-radius: 50%;
}

.dpad-center-btn {
    width: 50px;
    height: 50px;
    background: rgba(26, 26, 26, 0.35);
    border: 2px solid rgba(120, 120, 120, 0.8);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    /* iOS連打対策 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dpad-center-btn:active {
    background: rgba(80, 80, 80, 0.6);
    transform: scale(0.95);
}

/* ネオン効果 */
.neon-glow {
    box-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 20px currentColor,
        inset 0 0 5px rgba(255, 255, 255, 0.2);
}

/* ライン消去エフェクト */
@keyframes lineFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes lineClear {
    0% { 
        transform: scaleX(1);
        opacity: 1;
    }
    50% {
        transform: scaleX(1.1);
        opacity: 0.5;
    }
    100% { 
        transform: scaleX(0);
        opacity: 0;
    }
}

button {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    padding: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.1s;
    /* iOS連打対策 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.undo-button {
    background-color: #ffa500;
    color: #000;
}

.undo-button.hidden {
    display: none;
}
button:hover {
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

.pause-button {
    background-color: #ffff00;
    color: #000;
}

.reset-button {
    background-color: #00ffff;
    color: #000;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.overlay-content {
    background-color: #1e293b;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 3px solid;
}

.game-over-overlay {
    border-color: #ff0000;
}

.pause-overlay {
    border-color: #ffff00;
}

.overlay-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
}

.game-over-title {
    color: #ff0000;
}

.pause-title {
    color: #ffff00;
}

.overlay-score {
    font-size: 20px;
    color: #fff;
    margin-bottom: 20px;
}

.overlay-button {
    background-color: #00ffff;
    color: #000;
    font-size: 18px;
    padding: 15px 30px;
}

.hidden {
    display: none;
}

/* ホーム画面 */
.home-screen {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.home-title {
    font-size: 60px;
    color: #00ffff;
    letter-spacing: 12px;
    margin-bottom: 40px;
    text-shadow: 0 0 20px #00ffff;
}

/* タイトルコンテナとinfoボタン */
.home-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.home-title-container .home-title {
    margin-bottom: 0;
}

.info-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    color: #00ffff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.info-button:hover {
    background: #00ffff;
    color: #000;
    transform: scale(1.1);
}

/* Infoモーダル */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.info-modal.hidden {
    display: none;
}

.info-modal-content {
    background-color: #1e293b;
    padding: 30px;
    border-radius: 12px;
    border: 3px solid #00ffff;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.info-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid #888;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.info-modal-close:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: #fff;
}

.info-modal-title {
    font-size: 28px;
    color: #00ffff;
    text-align: center;
    margin-bottom: 25px;
    padding-right: 30px;
}

.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    font-size: 18px;
    color: #ffff00;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section p, .info-section ul {
    color: #ccc;
    font-size: 14px;
    line-height: 1.8;
}

.info-section ul {
    list-style: none;
    padding-left: 0;
}

.info-section li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.info-section li::before {
    content: "•";
    color: #00ffff;
    position: absolute;
    left: 0;
}

.info-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-controls-col h4 {
    color: #00ffff;
    font-size: 14px;
    margin-bottom: 8px;
}

.info-controls-col ul {
    font-size: 13px;
}

.info-divider {
    border: none;
    border-top: 1px solid rgba(71, 85, 105, 0.5);
    margin: 20px 0;
}

.info-contact {
    text-align: center;
    color: #888;
    font-size: 13px;
}

.info-contact a {
    color: #00ffff;
    text-decoration: none;
}

.info-contact a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .home-title-container {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 30px;
    }

    .info-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .info-modal-content {
        padding: 20px;
        max-height: 85vh;
    }

    .info-modal-title {
        font-size: 22px;
    }

    .info-section h3 {
        font-size: 16px;
    }

    .info-controls-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.mode-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.mode-button {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #00ffff;
    padding: 30px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-button:hover {
    transform: translateY(-5px);
    border-color: #ffff00;
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.3);
}

.mode-button h2 {
    color: #00ffff;
    font-size: 24px;
    margin-bottom: 10px;
}

.mode-button p {
    color: #aaa;
    font-size: 14px;
    margin: 5px 0;
}

.mode-button .best-time {
    color: #ffff00;
    font-size: 18px;
    margin-top: 10px;
    font-weight: bold;
}

/* AI観戦モードトグル */
.ai-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #ff00ff;
    border-radius: 12px;
    flex-wrap: wrap;
}

.ai-toggle-label {
    position: relative;
    width: 60px;
    height: 32px;
    cursor: pointer;
}

.ai-toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ai-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    border-radius: 32px;
    transition: 0.3s;
}

.ai-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.ai-toggle-label input:checked + .ai-toggle-slider {
    background: linear-gradient(135deg, #ff00ff, #8800ff);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

.ai-toggle-label input:checked + .ai-toggle-slider:before {
    transform: translateX(28px);
}

.ai-toggle-text {
    color: #ff00ff;
    font-size: 20px;
    font-weight: bold;
}

.ai-toggle-desc {
    color: #888;
    font-size: 14px;
    width: 100%;
    text-align: center;
}

.ai-toggle-desc.active {
    color: #ff00ff;
}

.rankings {
    background: rgba(30, 41, 59, 0.3);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid rgba(71, 85, 105, 0.3);
}

.rankings h3 {
    color: #00ffff;
    font-size: 24px;
    margin-bottom: 20px;
}

.ranking-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.ranking-tab {
    background: rgba(128, 128, 128, 0.3);
    color: #aaa;
    border: 1px solid #555;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.ranking-tab.active {
    background: #00ffff;
    color: #000;
    border-color: #00ffff;
}

.ranking-subtabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.ranking-subtab {
    background: rgba(128, 128, 128, 0.2);
    color: #888;
    border: 1px solid #444;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.ranking-subtab.active {
    background: linear-gradient(135deg, #ff00ff, #8800ff);
    color: #fff;
    border-color: #ff00ff;
}

.ranking-subtab:first-child.active {
    background: linear-gradient(135deg, #00aaff, #0066ff);
    border-color: #00aaff;
}

.ranking-list {
    text-align: left;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    margin: 8px 0;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
    border-left: 3px solid #00ffff;
}

.ranking-item .rank {
    color: #ffff00;
    font-weight: bold;
    min-width: 40px;
}

.ranking-item .time {
    color: #00ffff;
    font-weight: bold;
}

.ranking-item .date {
    color: #888;
    font-size: 12px;
}

/* タイム表示 */
.time-display {
    font-size: 18px;
    color: #ffff00;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.mode-info {
    font-size: 14px;
    color: #00ffff;
    text-align: center;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .home-title {
        font-size: 40px;
        letter-spacing: 8px;
        margin-bottom: 30px;
    }

    .mode-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .mode-button {
        padding: 20px 15px;
    }

    .mode-button h2 {
        font-size: 20px;
    }

    .ranking-tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .ranking-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5px;
        align-items: flex-start;
    }

    .game-container {
        gap: 10px;
        width: 100%;
        max-height: 100vh;
        padding-bottom: 180px; /* ボタン操作スペース確保 */
    }

    h1 {
        font-size: 24px;
        letter-spacing: 4px;
        margin-top: 5px;
    }

    .action-display {
        min-height: 30px;
    }

    .action-text {
        font-size: 14px;
        padding: 6px 12px;
    }

    .game-area {
        flex-direction: row;
        align-items: flex-start;
        width: 100%;
        gap: 8px;
        justify-content: center;
    }

    #gameCanvas {
        flex-shrink: 0;
    }

    .side-panel {
        width: auto;
        min-width: 100px;
        gap: 8px;
        flex-shrink: 1;
    }

    .panel-section {
        padding: 8px;
    }

    .panel-section h3 {
        font-size: 10px;
        margin-bottom: 4px;
    }

    #nextCanvas {
        width: 80px;
        height: 80px;
    }

    .score-label {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .score-value {
        font-size: 16px;
    }

    .button-group {
        gap: 6px;
    }

    button {
        font-size: 11px;
        padding: 8px 6px;
    }

    .overlay-content {
        padding: 20px;
        margin: 10px;
    }

    .overlay-title {
        font-size: 28px;
    }

    .overlay-score {
        font-size: 16px;
    }

    .overlay-button {
        font-size: 16px;
        padding: 12px 24px;
    }

    .dpad-btn {
        width: 70px;
        height: 70px;
        font-size: 20px;
    }

    .dpad-empty, .dpad-center, .dpad-center-btn {
        width: 70px;
        height: 70px;
    }

    .button-controls {
        right: 20px;
        bottom: 15px;
    }

    #controlTogglePanel {
        padding: 6px;
    }

    #controlTogglePanel h3 {
        font-size: 10px;
    }

    .toggle-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .game-area {
        gap: 6px;
    }

    .side-panel {
        min-width: 90px;
        gap: 6px;
    }

    .panel-section {
        padding: 6px;
    }

    #nextCanvas {
        width: 70px;
        height: 70px;
    }

    .score-value {
        font-size: 14px;
    }

    button {
        font-size: 10px;
        padding: 6px 4px;
    }
}

@media (min-width: 769px) {
    .side-panel {
        width: 200px;
    }
}

/* ===========================================
   練習モード・対戦モードボタン
   =========================================== */
.mode-button.practice-mode {
    border-color: #ffa500;
    background: linear-gradient(135deg, #2a1a00, #1a1000);
}
.mode-button.practice-mode:hover {
    border-color: #ffcc00;
    box-shadow: 0 5px 20px rgba(255, 165, 0, 0.3);
}
.mode-button.practice-mode h2 { color: #ffa500; }

.mode-button.battle-mode {
    border-color: #ff4444;
    background: linear-gradient(135deg, #2a0a0a, #1a0000);
}
.mode-button.battle-mode:hover {
    border-color: #ff6666;
    box-shadow: 0 5px 20px rgba(255, 68, 68, 0.3);
}
.mode-button.battle-mode h2 { color: #ff4444; }

/* ===========================================
   AI対戦難易度ダイアログ
   =========================================== */
.battle-dialog {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
}
.battle-dialog.hidden { display: none; }
.battle-dialog-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #ff4444;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}
.battle-dialog-content h3 { color: #ff4444; font-size: 24px; margin-bottom: 10px; }
.battle-dialog-content p { color: #888; font-size: 14px; margin-bottom: 20px; }
.battle-dialog-buttons { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.battle-btn {
    padding: 15px 30px; font-size: 18px; font-weight: bold;
    border: 2px solid; border-radius: 8px; cursor: pointer;
    transition: all 0.3s; width: 100%;
}
.battle-btn.easy { background: linear-gradient(135deg, #004400, #002200); border-color: #00ff00; color: #00ff00; }
.battle-btn.easy:hover { box-shadow: 0 0 20px rgba(0, 255, 0, 0.5); }
.battle-btn.normal { background: linear-gradient(135deg, #444400, #222200); border-color: #ffff00; color: #ffff00; }
.battle-btn.normal:hover { box-shadow: 0 0 20px rgba(255, 255, 0, 0.5); }
.battle-btn.hard { background: linear-gradient(135deg, #442200, #221100); border-color: #ff8800; color: #ff8800; }
.battle-btn.hard:hover { box-shadow: 0 0 20px rgba(255, 136, 0, 0.5); }
.battle-btn.expert { background: linear-gradient(135deg, #440000, #220000); border-color: #ff0000; color: #ff0000; }
.battle-btn.expert:hover { box-shadow: 0 0 20px rgba(255, 0, 0, 0.5); }
.battle-btn.master { background: linear-gradient(135deg, #220022, #110011); border-color: #ff00ff; color: #ff00ff; }
.battle-btn.master:hover { box-shadow: 0 0 20px rgba(255, 0, 255, 0.5); }
.battle-btn.inferno { background: linear-gradient(135deg, #331100, #110000); border-color: #ff4400; color: #ff4400; animation: infernoGlow 0.5s ease-in-out infinite alternate; }
.battle-btn.inferno:hover { box-shadow: 0 0 30px rgba(255, 68, 0, 0.8); }
@keyframes infernoGlow { from { box-shadow: 0 0 10px rgba(255, 68, 0, 0.5); } to { box-shadow: 0 0 20px rgba(255, 68, 0, 0.8); } }
.battle-dialog-cancel {
    background: transparent; border: 1px solid #666; color: #888;
    padding: 10px 20px; border-radius: 8px; cursor: pointer;
}
.battle-dialog-cancel:hover { border-color: #888; color: #fff; }

/* ===========================================
   AI対戦: AI盤面パネル
   =========================================== */
.ai-game-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.9);
    padding: 10px;
    border-radius: 12px;
    border: 2px solid #ff4444;
    margin-left: 20px;
}
.ai-game-panel.hidden { display: none; }
.ai-panel-header {
    color: #ff4444;
    font-size: 16px;
    font-weight: bold;
}
.ai-game-panel canvas {
    border: 2px solid #475569;
}
.ai-panel-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #fff;
    font-size: 11px;
    text-align: center;
}
.ai-panel-stats span { color: #ff4444; font-weight: bold; }

/* スマホ対応 */
@media (max-width: 768px) {
    .ai-game-panel {
        display: none;
    }
}

/* ===========================================
   AI対戦: モバイル用AIゲージ
   =========================================== */
.ai-gauge-panel {
    display: none;
}
.ai-gauge-panel.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .ai-gauge-panel:not(.hidden) {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        background: rgba(30, 41, 59, 0.9);
        padding: 8px;
        border-radius: 8px;
        border: 2px solid #ff4444;
    }
    .ai-gauge-header {
        color: #ff4444;
        font-size: 11px;
        font-weight: bold;
    }
    .ai-gauge-container {
        width: 20px;
        height: 80px;
        background: #1e293b;
        border: 1px solid #475569;
        border-radius: 4px;
        position: relative;
        overflow: hidden;
    }
    .ai-gauge-bar {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 0%;
        background: linear-gradient(to top, #ff4444, #ff8888);
        transition: height 0.1s ease-out;
    }
    .ai-gauge-lines {
        color: #fff;
        font-size: 9px;
    }
    .ai-gauge-lines span {
        color: #ff4444;
        font-weight: bold;
    }
}

/* PC: ゲージは非表示（AI盤面を表示） */
@media (min-width: 769px) {
    .ai-gauge-panel {
        display: none !important;
    }
}
