/* =========================================
   遊戲十：擊石鳴詩（Arkanoid Verse）
   - 中國風打磚塊，消除詩詞
   ========================================= */

/* 遊戲全屏遮罩：背景使用放射狀漸變，營造深邃感 */
.game10-overlay {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    background: radial-gradient(circle at center, hsl(210, 30%, 20%) 0%, hsl(0, 0%, 0%) 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: hsl(40, 50%, 80%);
    font-family: 'Noto Serif TC', serif;
    zoom: 1;
    -webkit-text-size-adjust: 100%;
}

/* 通用隱藏類別 */
.hidden {
    display: none !important;
}

/* 遊戲頂部資訊列（分數與控制） */
.game10-header {
    padding: 2px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
    z-index: 10;
    width: 100%;
    height: 40px;
}

.game10-score-board {
    color: hsl(50, 70%, 60%);
    font-size: 24px;
    font-weight: bold;
    padding-left: 50px;
}

/* 控制按鈕（重來／開新局） */
.game10-controls .nav-btn {
    padding: 0px 10px;
    background: hsl(0, 60%, 25%);
    border: 0.6px solid hsla(40, 100%, 80%, 0.3);
    color: hsl(45, 80%, 70%);
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.game10-controls .nav-btn:hover {
    background: hsl(0, 60%, 50%);
    color: hsl(45, 80%, 90%);
}

.game10-controls .nav-btn:disabled {
    background: hsl(0, 0%, 50%);
    color: hsl(45, 0%, 90%);
}

/* 難度標籤 */
.game10-difficulty-tag {
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 20px;
    color: hsl(45, 30%, 85%);
    border: 0.6px solid hsla(40, 100%, 80%, 0.1);
    z-index: 100;
    cursor: pointer;
    transition: all 0.2s;
}

.game10-difficulty-tag[data-level="小學"] {
    background: linear-gradient(135deg, hsl(100, 40%, 40%) 0%, hsl(120, 40%, 30%) 100%);
}

.game10-difficulty-tag[data-level="中學"] {
    background: linear-gradient(135deg, hsl(210, 40%, 50%) 0%, hsl(230, 40%, 40%) 100%);
}

.game10-difficulty-tag[data-level="高中"] {
    background: linear-gradient(135deg, hsl(0, 50%, 50%) 0%, hsl(0, 50%, 35%) 100%);
}

.game10-difficulty-tag[data-level="大學"] {
    background: linear-gradient(135deg, hsl(290, 50%, 50%) 0%, hsl(270, 50%, 35%) 100%);
}

.game10-difficulty-tag[data-level="研究所"] {
    background: linear-gradient(135deg, hsl(50, 80%, 50%) 0%, hsl(40, 80%, 35%) 100%);
}

.game10-difficulty-tag:hover {
    box-shadow: 0 0px 8px rgba(255, 255, 255, 0.9);
    filter: brightness(1.5);
}

/*紅心區域*/
.game10-sub-header {
    display: flex;
    justify-content: center;
    align-items: center;
    /* 垂直居中 */
    background: rgba(0, 0, 0, 0.4);
    z-index: 9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    height: 40px;
}

.hearts {
    display: flex;
    gap: 2px;
    justify-content: center;
    flex-wrap: wrap;
}

.heart {
    color: hsl(4, 90%, 60%);
    font-size: 32px;
}

.heart.empty {
    opacity: 0.9;
}

/* 遊戲遊玩核心區域：限制所有內容在此範圍內 */
.game10-area {
    display: block;
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    /* 禁用瀏覽器預設觸控行為，防止滾動 */
}

/* 詩詞資訊 */
.game10-poem-info {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 20px;
    color: hsl(40, 50%, 80%);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    z-index: 100;
}

/* Paddle (玉如意 / 墨錠) */
/* 撞擊條 (Jade Paddle)：使用玉石般的漸變與邊框 */
.game10-paddle {
    position: absolute;
    height: 16px;
    background: linear-gradient(to top, hsl(150, 20%, 30%), hsl(150, 30%, 50%));
    border: 2px solid hsl(150, 40%, 70%);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 4px hsla(0, 0%, 100%, 0.3);
    z-index: 50;
    transform: translate(-50%, -50%);
    /* 確保 JS 設定的 left/top 對準中心點 */
}

.game10-paddle.flash-pink-sides::before,
.game10-paddle.flash-pink-sides::after {
    content: '';
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: var(--pink-side-width, 10%);
    background: linear-gradient(to top, hsl(330, 40%, 40%), hsl(330, 50%, 60%));
    border: 2px solid hsl(330, 60%, 80%);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 4px hsla(0, 0%, 100%, 0.3);
    z-index: 2;
}

.game10-paddle.flash-pink-sides::before {
    left: -2px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.game10-paddle.flash-pink-sides::after {
    right: -2px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* 圓球 (Pearl Ball)：白色珍珠質感與外發光效果 */
.game10-ball {
    position: absolute;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 10px hsla(0, 0%, 100%, 0.8);
    z-index: 49;
    transform: translate(-50%, -50%);
    /* 確保 JS 設定的 left/top 對準中心點 */
}

/* 球軌跡的粒子 */
.game10-trail-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: hsla(0, 0%, 100%, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 48;
    animation: game10-trail-fade 0.5s linear forwards;
}

@keyframes game10-trail-fade {
    to {
        transform: scale(0.1);
        opacity: 0;
    }
}

/* 磚塊容器與個別磚塊 */
.game10-bricks-container {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 45;
}

.game10-brick {
    position: absolute;
    width: 50px;
    /* 由 JS 動態設定，這裡設定預設值 */
    height: 50px;
    pointer-events: none;
    /* 由 JS 判定碰撞，DOM 僅作渲染 */
    z-index: 45;
}

.game10-brick-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    /*方塊與字體控制部分是寫在game10.js*/
    font-weight: bold;
    color: hsl(0, 0%, 100%);
    background: hsl(32, 100%, 100%);
    border: 2px solid hsla(0, 0%, 100%, 0.3);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.1s;
    /* 只允許背景顏色過渡 */
}

/* 磚塊被撞擊後的震動階段 */
.game10-brick-inner.shake {
    animation: game10-hit-shake 0.15s ease-out;
}

/* 磚塊被擊碎後的狀態：隱藏邊框與底色，僅保留半透明文字 */
.game10-brick.broken {
    background: transparent !important;
    border: none !important;
    box-shadow: none;
    color: hsl(0, 0%, 100%);
    border: 2px solid hsla(0, 0%, 0%, 0.0);
    /*border也無法消除被擊破的文字的邊框*/
    text-shadow: 0 0 4px rgba(255, 200, 0, 1);
    pointer-events: none;
    opacity: 0.3;
    /* 半透明顯示，避免干擾玩家 */
    /* 擊碎後不再接收碰撞 */
}

/* 震動動畫定義 */
@keyframes game10-hit-shake {
    0% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-3deg);
    }

    50% {
        transform: scale(1.1) rotate(3deg);
    }

    75% {
        transform: scale(1.1) rotate(0deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.game10-brick.shake {
    display: none;
}

/* 舊類別棄用 */

/* Fly away animation (拓印) */
.game10-brick.fly-away {
    transition: transform 1.5s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 1.5s ease-out;
    opacity: 0 !important;
}

/* 文字框碎片 */
.game10-shatter-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 48;
    transition: transform 0.66s ease-out, opacity 0.66s ease-out;
}

/* 煙火粒子 */
.game10-firework-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 55;
    transition: transform 1s ease-out, opacity 1s ease-out;
    filter: blur(1px);
    box-shadow: 0 0 4px #fff;
}

/* 倒數計時 */
.game10-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    font-weight: bold;
    color: hsl(50, 100%, 70%);
    /* 淡黃色 */
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 40px hsl(50, 100%, 50%);
    z-index: 150;
    pointer-events: none;
    animation: game10-cd-pulse 1s linear infinite;
}

@keyframes game10-cd-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    90% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* .game10-message Styles Removed - Using Unified GameMessage Component */