/* 2026 小小 Podcast 暑期營 | 手帳文青風格設計系統 */

:root {
    --color-milk-tea: #F4F1DE; /* 燕麥奶暖白 */
    --color-paper: #FFFDF9;    /* 手帳紙張白 */
    --color-cream: #F2CC8F;    /* 溫暖鵝黃 */
    --color-orange-light: #F4A261; /* 溫馨橘 */
    --color-accent: #E07A5F;   /* 焦糖紅褐 */
    --color-blue-light: #A8DADC;/* 湖水綠藍 */
    --color-forest: #81B29A;   /* 酪梨草綠 */
    --color-text: #3D348B;     /* 電台藏青深色字 */
    --color-border: #5D4037;   /* 手繪可可色線條 */
    --font-hand: 'Gaegu', 'Noto Sans TC', sans-serif;
    --shadow-doodle: 4px 4px 0px var(--color-border);
    --shadow-hover: 8px 8px 0px var(--color-border);
    --radius-doodle: 24px;
}

@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=Noto+Sans+TC:wght@400;500;700&display=swap');

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

body {
    background-color: var(--color-milk-tea);
    background-image: 
        radial-gradient(var(--color-cream) 15%, transparent 16%),
        radial-gradient(var(--color-cream) 15%, transparent 16%);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    font-family: var(--font-hand);
    color: var(--color-text);
    overflow-x: hidden;
    padding: 20px 10px;
    line-height: 1.6;
}

/* 滾動條可愛化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-milk-tea);
}
::-webkit-scrollbar-thumb {
    background: var(--color-orange-light);
    border: 2px solid var(--color-border);
    border-radius: 5px;
}

/* ================= 手帳大容器外框 ================= */
.notebook-container {
    max-width: 1250px;
    margin: 0 auto;
    background: var(--color-paper);
    border: 4px solid var(--color-border);
    border-radius: 30px;
    box-shadow: 12px 12px 0px rgba(93, 64, 55, 0.15);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

/* 頂部撕開紙膠帶標題 */
.washi-tape-header {
    text-align: center;
    padding: 25px 15px;
    margin-bottom: 30px;
    position: relative;
}

.header-tape {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    background: rgba(242, 204, 143, 0.8);
    color: var(--color-border);
    padding: 6px 40px;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px dashed var(--color-border);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
    z-index: 10;
}

.washi-tape-header h1 {
    font-size: 2.8rem;
    color: var(--color-accent);
    text-shadow: 3px 3px 0px var(--color-cream);
    margin-top: 15px;
}

.washi-tape-header .subtitle {
    font-size: 1.3rem;
    color: var(--color-border);
    font-style: italic;
    margin-top: 5px;
}

/* ================= 手帳書籤頁籤 (Tabs) ================= */
.notebook-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: -4px; /* 與內頁無縫黏合 */
    position: relative;
    z-index: 5;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-btn {
    padding: 12px 24px;
    font-family: var(--font-hand);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--color-border);
    background: var(--color-milk-tea);
    border: 3px solid var(--color-border);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--color-cream);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--color-paper);
    color: var(--color-accent);
    padding-bottom: 16px;
    transform: translateY(0);
}

/* ================= 手帳內頁主體 ================= */
.notebook-page {
    border: 4px solid var(--color-border);
    border-radius: 0 24px 24px 24px;
    background: var(--color-paper);
    padding: 30px;
    min-height: 600px;
    position: relative;
}

/* 顯示與隱藏頁面 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= 通用手繪紙張卡片 (paper-card) ================= */
.paper-card {
    background: var(--color-paper);
    border: 3px solid var(--color-border);
    border-radius: var(--radius-doodle);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-doodle);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.paper-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.paper-card h2 {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px dashed var(--color-border);
    padding-bottom: 10px;
}

.paper-card h3 {
    font-size: 1.5rem;
    color: var(--color-text);
    margin-bottom: 12px;
}

.section-desc {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* 手帳小裝飾膠帶 */
.tape-decor {
    position: absolute;
    top: -12px;
    left: 20px;
    width: 80px;
    height: 24px;
    background: rgba(168, 220, 220, 0.6);
    transform: rotate(-5deg);
    border-left: 2px dashed rgba(0,0,0,0.1);
    border-right: 2px dashed rgba(0,0,0,0.1);
}

/* 手帳郵票裝飾 */
.stamp-decor {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background-color: var(--color-cream);
    border: 2px dashed var(--color-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transform: rotate(8deg);
}

/* ================= TAB 1: RPG 系統樣式 ================= */
.rpg-dashboard {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 25px;
}

/* 左欄：個人檔案卡 */
.rpg-profile-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    background: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: 2px 2px 0 var(--color-border);
}

.player-title h3 {
    margin-bottom: 4px;
    color: var(--color-border);
    font-size: 1.6rem;
}

.badge {
    background: var(--color-accent);
    color: white;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: bold;
    border: 2px solid var(--color-border);
}

/* XP 經驗條 */
.xp-container {
    background: rgba(242, 204, 143, 0.2);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 12px;
}

.xp-text {
    font-size: 1.05rem;
    font-weight: bold;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.xp-bar-bg {
    width: 100%;
    height: 18px;
    background: white;
    border-radius: 9px;
    border: 2px solid var(--color-border);
    overflow: hidden;
}

.xp-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--color-orange-light);
    border-right: 2px solid var(--color-border);
    transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 能力值雷達儀表 */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: grid;
    grid-template-columns: 30px 80px 1fr 40px;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 1.3rem;
}

.stat-name {
    font-weight: bold;
    font-size: 1.05rem;
}

.stat-meter-bg {
    height: 12px;
    background: white;
    border-radius: 6px;
    border: 2px solid var(--color-border);
    overflow: hidden;
}

.stat-meter-fill {
    height: 100%;
    background: var(--color-forest);
    transition: width 0.5s ease-out;
}

.stat-val {
    font-weight: bold;
    text-align: right;
    font-size: 1.1rem;
}

/* 右欄：任務與成就 */
.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border: 2px solid var(--color-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    position: relative;
    transition: background 0.3s;
}

.task-item.completed {
    background: rgba(129, 178, 154, 0.2);
    text-decoration: line-through;
    opacity: 0.8;
}

.task-item.completed input[type="checkbox"] {
    accent-color: var(--color-forest);
}

.task-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-xp {
    margin-left: auto;
    background: var(--color-cream);
    border: 2px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* 榮譽徽章牆 */
.achievements-section {
    border-top: 2px dashed var(--color-border);
    padding-top: 20px;
}

.achievements-section h3 {
    margin-bottom: 15px;
    font-size: 1.35rem;
}

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 85px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: help;
}

.badge-item.locked {
    filter: grayscale(1) opacity(0.4);
}

.badge-item.unlocked {
    filter: none;
    opacity: 1;
    transform: scale(1.05);
}

.badge-icon {
    width: 55px;
    height: 55px;
    border: 3px solid var(--color-border);
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 8px;
    box-shadow: 2px 2px 0 var(--color-border);
    transition: transform 0.2s;
}

.badge-item.unlocked:hover .badge-icon {
    transform: rotate(15deg) scale(1.1);
}

.badge-name {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.2;
}

/* ================= 郵票冒險地圖 ================= */
.story-map-section {
    margin-top: 10px;
}

.story-chapters-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.chapter-stamp {
    background: var(--color-paper);
    border: 3px solid var(--color-border);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    position: relative;
    box-shadow: 3px 3px 0 var(--color-border);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 仿郵票邊緣花邊效果 */
.stamp-border {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 4px dotted var(--color-paper);
    pointer-events: none;
    margin: -3px;
    border-radius: 12px;
}

.chapter-stamp:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 6px 6px 0 var(--color-border);
}

.chapter-stamp.locked {
    filter: grayscale(1) opacity(0.5);
    cursor: not-allowed;
}

.chapter-stamp.locked:hover {
    transform: none;
    box-shadow: 3px 3px 0 var(--color-border);
}

.chapter-stamp.active {
    border-color: var(--color-accent);
    background: rgba(242, 204, 143, 0.3);
}

.ch-num {
    font-size: 0.85rem;
    background: var(--color-border);
    color: white;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: bold;
}

.stamp-img {
    font-size: 2.8rem;
    margin: 10px 0;
}

.chapter-stamp h4 {
    font-size: 1.15rem;
    color: var(--color-border);
    margin-bottom: 5px;
}

.ch-status {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--color-accent);
}

/* 劇情對話框 */
.story-dialogue-box {
    display: flex;
    gap: 20px;
    background: var(--color-paper);
    border: 3px solid var(--color-border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 3px 3px 0 var(--color-border);
    animation: popUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUp {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.story-character-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.story-bubble {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.story-bubble h4 {
    font-size: 1.25rem;
    color: var(--color-accent);
}

.story-bubble p {
    font-size: 1.1rem;
    color: var(--color-border);
}

.story-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ================= 選擇角色組合 ================= */
.char-card {
    background: var(--color-paper);
    border: 3px solid var(--color-border);
    border-radius: var(--radius-doodle);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
}

.char-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.char-card.selected {
    background: var(--color-orange-light);
    border-color: var(--color-accent);
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.char-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    margin: 0 auto 12px;
}

.char-card h3 {
    font-size: 1.35rem;
    color: var(--color-border);
    margin-bottom: 5px;
}

.char-desc {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 10px;
}

.char-skill {
    display: block;
    background: var(--color-paper);
    border: 2px dashed var(--color-border);
    border-radius: 10px;
    padding: 4px 8px;
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: bold;
}

/* ================= TAB 2: 播音錄音工作室 ================= */
.studio-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 30px;
}

.studio-left {
    display: flex;
    flex-direction: column;
}

/* 錄音間大畫面 */
#hero-scene {
    position: relative;
    width: 100%;
    height: 480px;
    background-image: url('recording_studio_bg_1778749193895.png');
    background-size: cover;
    background-position: center;
    border: 5px solid var(--color-border);
    border-radius: var(--radius-doodle);
    overflow: hidden;
    box-shadow: var(--shadow-doodle);
    margin-bottom: 30px;
    transition: transform 0.5s ease;
}

#hero-scene.zoomed {
    transform: scale(1.02);
}

/* 錄音中全滿屏紅框警告 */
#hero-scene.recording-active::before {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    border: 10px solid #ff4757;
    pointer-events: none;
    z-index: 90;
    animation: recordingBorders 1.5s infinite alternate;
}

@keyframes recordingBorders {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.on-air-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    color: #ff4757;
    font-size: 6rem;
    font-weight: bold;
    text-shadow: 0 0 20px #ff4757;
}

.rec-light {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.7);
    padding: 6px 15px;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    border: 2px solid white;
    z-index: 95;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background-color: #ff4757;
    border-radius: 50%;
    animation: blink 1s infinite;
}

/* 裝備重疊顯示 */
.studio-equip-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 95;
}

.equip-item {
    background: rgba(255,255,255,0.85);
    border: 2px solid var(--color-border);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--color-border);
}

.dual-host-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding-bottom: 40px;
}

.active-host {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s;
    opacity: 0.6;
    transform: scale(0.85);
    position: relative;
}

.active-host.speaking {
    opacity: 1;
    transform: scale(1.1);
}

.active-host .host-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 4px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.active-host.speaking .host-avatar {
    border-color: var(--color-accent);
    box-shadow: 0 0 20px var(--color-orange-light);
}

.host-label {
    margin-top: 8px;
    background: var(--color-border);
    color: white;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: bold;
}

.speech-bubble {
    position: absolute;
    bottom: 140px;
    background: white;
    border: 3px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 15px;
    box-shadow: 3px 3px 0 var(--color-border);
    max-width: 160px;
    font-weight: bold;
    font-size: 0.85rem;
    text-align: center;
    z-index: 10;
    pointer-events: none;
    transform-origin: bottom center;
    animation: speakWobble 2s infinite alternate;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border: 8px solid transparent;
    border-top-color: white;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -19px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border: 8px solid transparent;
    border-top-color: var(--color-border);
}

@keyframes speakWobble {
    from { transform: rotate(-2deg); }
    to { transform: rotate(2deg); }
}

/* AI 語音教練提示框 */
.ai-coach-bubble {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFF;
    border: 3px solid var(--color-border);
    border-radius: 16px;
    padding: 8px 20px;
    box-shadow: 3px 3px 0 var(--color-border);
    font-size: 0.95rem;
    z-index: 95;
    white-space: nowrap;
    animation: coachPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes coachPop {
    0% { transform: translate(-50%, 20px) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* ================= 創意抽題與扭蛋生成器 ================= */
.creative-generators {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.generator-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 250px;
}

.doodle-box {
    width: 100%;
    background: var(--color-milk-tea);
    border: 2px dashed var(--color-border);
    border-radius: 14px;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    color: var(--color-border);
    margin: 15px 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 題目卡翻轉效果 */
.card-display {
    perspective: 1000px;
    width: 150px;
    height: 180px;
    margin: 10px 0;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-inner.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 3px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 2px 2px 0 var(--color-border);
}

.card-front {
    background: var(--color-accent);
    color: white;
}

.question-doodle {
    font-size: 3rem;
}

.card-back {
    background: white;
    color: var(--color-text);
    transform: rotateY(180deg);
    overflow: hidden;
}

#question-category {
    font-size: 0.95rem;
    background: var(--color-cream);
    padding: 2px 8px;
    border-radius: 8px;
    margin-bottom: 5px;
    color: var(--color-border);
}

#question-text {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.3;
}

/* 扭蛋機樣式 */
.gashapon-machine {
    width: 120px;
    height: 160px;
    background: var(--color-blue-light);
    border-radius: 50% 50% 10px 10px;
    position: relative;
    border: 3px solid var(--color-border);
    margin: 10px 0;
}

.gasha-glass {
    width: 85%;
    height: 55%;
    background: rgba(255,255,255,0.6);
    margin: 10% auto 0;
    border-radius: 50%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px;
    overflow: hidden;
    border: 2px solid var(--color-border);
}

.capsule {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 1px;
    border: 1px solid var(--color-border);
    animation: float 2s infinite ease-in-out;
}

.gasha-crank {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.4s;
}

.gasha-crank:hover {
    transform: translateX(-50%) rotate(180deg);
}

/* ================= 播音控制面板 ================= */
.waveform-container {
    width: 100%;
    background: #000;
    border-radius: 12px;
    padding: 10px;
    border: 3px solid var(--color-border);
    position: relative;
    height: 100px;
    overflow: hidden;
    margin-bottom: 15px;
}

.wave-label {
    position: absolute;
    top: 5px;
    left: 10px;
    color: var(--color-forest);
    font-size: 0.8rem;
    font-family: monospace;
}

#waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.recording-stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 15px;
}

.record-timer {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-accent);
    font-family: monospace;
    border: 2px solid var(--color-border);
    padding: 5px 15px;
    border-radius: 10px;
    background: var(--color-paper);
}

.recording-status {
    flex: 1;
    font-weight: bold;
    color: var(--color-border);
}

/* 突發事件卡 */
.random-event-box {
    background: #FFD8BE;
    border: 3px solid var(--color-border);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 2px 2px 0 var(--color-border);
    animation: wobble 0.5s ease-in-out;
}

.event-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: #D62246;
    margin-bottom: 5px;
}

.event-desc {
    font-size: 1rem;
    color: var(--color-border);
}

/* 按鈕大合集 */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

button {
    padding: 10px 20px;
    font-family: var(--font-hand);
    font-size: 1.1rem;
    font-weight: bold;
    border: 2px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: 3px 3px 0 var(--color-border);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0 var(--color-border);
}

button:active {
    transform: translateY(2px);
    box-shadow: 1px 1px 0 var(--color-border);
}

button:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 3px 3px 0 var(--color-border);
}

.btn-primary { background: var(--color-orange-light); color: var(--color-border); }
.btn-secondary { background: var(--color-milk-tea); color: var(--color-border); }
.btn-success { background: var(--color-forest); color: white; }

/* ================= 真正電台音效控制台 ================= */
.bgm-player-panel {
    background: var(--color-paper);
    border: 2px dashed var(--color-border);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 20px;
}

.bgm-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

#bgm-selector {
    padding: 8px;
    font-family: var(--font-hand);
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
}

.bgm-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bgm-slider input[type="range"] {
    flex: 1;
    accent-color: var(--color-accent);
}

.sound-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.sound-tab-btn, .sticker-tab-btn {
    padding: 6px 12px;
    font-size: 0.95rem;
    border-radius: 12px;
    box-shadow: 2px 2px 0 var(--color-border);
    white-space: nowrap;
}

.sound-tab-btn.active, .sticker-tab-btn.active {
    background: var(--color-accent);
    color: white;
}

.sound-cat-content {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sound-cat-content.active {
    display: grid;
}

.sound-btn {
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-paper);
    border: 2px solid var(--color-border);
    border-radius: 14px;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 3px 3px 0 var(--color-border);
    transition: all 0.2s;
    line-height: 1.2;
}

.sound-btn:hover {
    background: var(--color-cream);
}

/* 解鎖工坊 */
.unlock-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.unlock-item {
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 15px;
    background: white;
}

.unlock-item.locked {
    filter: grayscale(1);
    opacity: 0.5;
}

.unlock-item.unlocked {
    background: rgba(129, 178, 154, 0.1);
}

.unlock-icon {
    font-size: 2rem;
}

.unlock-name {
    font-weight: bold;
    font-size: 1.05rem;
}

.unlock-desc {
    font-size: 0.85rem;
    color: #666;
}

/* ================= TAB 3: 拍貼與封面設計 ================= */
.photobooth-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 30px;
}

/* 拍立得手帳設計容器 */
.polaroid-wrapper {
    background: white;
    border: 3px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 20px 40px 20px;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.1);
    position: relative;
    margin-bottom: 25px;
}

.tape-decor-top {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    width: 120px;
    height: 30px;
    background: rgba(242, 204, 143, 0.7);
    border-left: 2px dashed var(--color-border);
    border-right: 2px dashed var(--color-border);
}

/* 核心封面畫布 */
.cover-design-workspace {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #EFEFEF;
    border: 3px solid var(--color-border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: default;
}

.cover-background-layer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#webcam-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-fallback-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-milk-tea);
    text-align: center;
    padding: 20px;
    color: var(--color-border);
}

.placeholder-emoji {
    font-size: 4rem;
    margin-bottom: 10px;
}

/* 自訂標題與主持人文字層 */
.cover-text-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 5;
    background: rgba(255,255,255,0.85);
    border: 2px solid var(--color-border);
    border-radius: 10px;
    padding: 10px;
    pointer-events: none; /* 防止遮擋貼紙拖拽 */
    text-align: center;
}

#editable-cover-title {
    font-size: 1.4rem;
    color: var(--color-accent);
    margin-bottom: 2px;
    font-weight: bold;
}

#editable-cover-author {
    font-size: 0.95rem;
    color: var(--color-border);
}

.cover-logo-stamp {
    display: inline-block;
    background: var(--color-cream);
    color: var(--color-border);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    margin-top: 4px;
}

.polaroid-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-weight: bold;
    color: var(--color-border);
    font-size: 1.1rem;
}

.rec-time-badge {
    background: var(--color-milk-tea);
    border: 2px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 快門閃光 */
.shutter-flash {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 99;
}

/* ================= 貼紙操作核心 (拖拉縮放旋轉) ================= */
.stickers-container {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
}

.sticker-item {
    position: absolute;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    z-index: 100;
    pointer-events: auto; /* 必須能感應滑鼠 */
    user-select: none;
    touch-action: none; /* 防止平板滾動干擾 */
    transform-origin: center center;
}

.sticker-item-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* 對話氣泡貼紙 */
.sticker-item.text-sticker {
    width: auto !important;
    height: auto !important;
    min-width: 80px;
}

.sticker-item.text-sticker .sticker-item-content {
    font-size: 0.95rem;
    font-weight: bold;
    background: white;
    border: 3px solid var(--color-border);
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow: 2px 2px 0 var(--color-border);
    white-space: nowrap;
    text-align: center;
    display: inline-block;
}

/* 啟動選中狀態的貼紙外線框與控制點 */
.sticker-item.active-sticker {
    outline: 2px dashed var(--color-accent);
}

.sticker-control {
    position: absolute;
    background: var(--color-accent);
    color: white;
    border: 1px solid var(--color-border);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 105;
}

/* 只在被點擊啟動的貼紙上顯示按鈕 */
.sticker-item.active-sticker .sticker-control {
    display: flex;
}

.sticker-del {
    top: -10px;
    right: -10px;
    background: #ff4757;
}

.sticker-rot {
    bottom: -10px;
    right: -10px;
    background: var(--color-orange-light);
    cursor: nwse-resize;
}

/* 封面自訂文字輸入 */
.cover-text-inputs {
    margin-top: 15px;
}

.input-row {
    display: flex;
    gap: 15px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: bold;
    color: var(--color-border);
}

.input-group input {
    padding: 8px 12px;
    font-family: var(--font-hand);
    font-size: 1.05rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    outline: none;
}

.photobooth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

/* 右側：拍照任務與貼紙清單 */
.photo-tasks {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.photo-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 15px;
    background: white;
    cursor: pointer;
}

.photo-task-item.active {
    border-color: var(--color-accent);
    background: rgba(244, 162, 97, 0.1);
}

.photo-task-item.completed {
    background: rgba(129, 178, 154, 0.1);
    opacity: 0.8;
}

.photo-task-item.completed .task-check {
    color: var(--color-forest);
    font-weight: bold;
}

.task-t {
    font-weight: bold;
    font-size: 1.05rem;
}

.task-award {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: bold;
}

/* 貼紙與背景選單 */
.sticker-cat-content {
    display: none;
}

.sticker-cat-content.active {
    display: block;
}

.sticker-selector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.sticker-option {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 2px 2px 0 var(--color-border);
}

.sticker-option:hover {
    background: var(--color-cream);
}

.custom-text-sticker-tool {
    margin-top: 20px;
    border-top: 2px dashed var(--color-border);
    padding-top: 15px;
}

.text-sticker-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.text-sticker-row input {
    flex: 1;
    padding: 6px 12px;
    font-family: var(--font-hand);
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 10px;
}

.background-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.bg-option {
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--color-border);
}

.bg-option.active {
    border-color: var(--color-accent);
    box-shadow: 4px 4px 0 var(--color-accent);
    transform: translate(-1px, -1px);
}

/* ================= TAB 4: 多人派對挑戰 ================= */
.party-modes-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.party-action-box {
    text-align: center;
    margin: 15px 0;
}

.roulette-results-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.roulette-result {
    display: flex;
    flex-direction: column;
}

.r-label {
    font-weight: bold;
    color: var(--color-border);
    font-size: 1rem;
    margin-bottom: 5px;
}

.text-accent {
    color: var(--color-accent) !important;
}

/* 搶答大按鈕 */
.buzzer-container {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 20px 0;
}

.buzzer-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.buzzer-btn {
    width: 100%;
    height: 90px;
    color: white !important;
    border: 3px solid var(--color-border) !important;
    font-size: 1.3rem !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 0 var(--color-border) !important;
    transition: all 0.1s;
}

.buzzer-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 var(--color-border) !important;
}

.buzzer-light {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #555;
    border: 2px solid var(--color-border);
}

.buzzer-light.lit {
    background: #ffe066;
    box-shadow: 0 0 15px #ffe066;
    animation: flashBuzzer 0.5s infinite alternate;
}

@keyframes flashBuzzer {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* 觀眾投票與留言板 */
.voting-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.vote-box {
    background: var(--color-milk-tea);
    border: 2px solid var(--color-border);
    border-radius: 14px;
    padding: 15px;
    text-align: center;
    box-shadow: 2px 2px 0 var(--color-border);
}

.vote-box h4 {
    font-size: 1.1rem;
    color: var(--color-border);
}

.vote-count {
    display: block;
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--color-accent);
    margin: 8px 0;
}

.vote-trigger {
    width: 100%;
}

/* 漂浮留言牆 */
.bullet-chat-container {
    margin-top: 25px;
    border-top: 2px dashed var(--color-border);
    padding-top: 20px;
}

.bullet-comments-wall {
    width: 100%;
    height: 120px;
    background: var(--color-border);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.3);
}

.bullet-comment {
    position: absolute;
    white-space: nowrap;
    color: white;
    font-size: 1.05rem;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    text-shadow: 1px 1px 2px black;
    animation: scrollBullet 10s linear infinite;
}

@keyframes scrollBullet {
    0% { left: 100%; }
    100% { left: -100%; }
}

/* ================= 滾動快訊跑馬燈 ================= */
.radio-marquee {
    background: var(--color-border);
    color: white;
    padding: 6px 0;
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    font-size: 1rem;
    font-weight: bold;
    border-top: 3px solid var(--color-border);
    z-index: 80;
}

.radio-marquee marquee {
    padding-top: 3px;
}

/* ================= 節目卡 Modal ================= */
.program-card-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.program-card {
    background: var(--color-milk-tea);
    width: 440px;
    padding: 30px;
    border-radius: 24px;
    border: 6px solid var(--color-border);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

.card-header {
    background: var(--color-accent);
    color: white;
    padding: 6px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: bold;
    border: 2px solid var(--color-border);
}

.card-cover-art-preview {
    width: 250px;
    height: 250px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    border: 4px solid var(--color-border);
    overflow: hidden;
    position: relative;
}

.card-cover-art-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    width: 100%;
    text-align: left;
    background: var(--color-paper);
    padding: 15px 20px;
    border-radius: 14px;
    font-size: 0.95rem;
    margin-bottom: 15px;
    border: 2px solid var(--color-border);
}

.card-info div {
    margin-bottom: 6px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 3px;
}

.card-stats {
    display: flex;
    gap: 20px;
    font-weight: bold;
    color: var(--color-accent);
    font-size: 1.1rem;
}

.btn-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: #ff4757;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0 var(--color-border);
    font-family: monospace;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= 飄浮手繪貼飾 ================= */
.sticker {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    animation: float 4s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-12px) rotate(4deg); }
}

/* ================= 響應式適配 ================= */
@media (max-width: 992px) {
    .rpg-dashboard {
        grid-template-columns: 1fr;
    }
    .studio-layout {
        grid-template-columns: 1fr;
    }
    .photobooth-layout {
        grid-template-columns: 1fr;
    }
    .party-modes-container {
        grid-template-columns: 1fr;
    }
    #hero-scene {
        height: 380px;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .washi-tape-header h1 { font-size: 2.2rem; }
    .notebook-page { padding: 15px; }
    .creative-generators {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}
