/* ==========================================================================
   SPEAK CRAFT - Speech Conquest RPG Stylesheet
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #070a12;
    --bg-card: rgba(18, 24, 38, 0.85);
    --bg-card-hover: rgba(28, 36, 56, 0.9);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-highlight: rgba(0, 242, 254, 0.5);

    --primary-cyan: #00f2fe;
    --primary-purple: #9d4edd;
    --accent-gold: #ffb703;
    --accent-green: #00ff9d;
    --accent-red: #ff0055;
    --accent-orange: #ff7b00;

    --text-main: #f0f4f8;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Fonts */
    --font-heading: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
    --font-body: 'Inter', 'Zen Kaku Gothic New', sans-serif;

    /* Effects */
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
    --glow-cyan: 0 0 25px rgba(0, 242, 254, 0.35);
    --glow-purple: 0 0 25px rgba(157, 78, 221, 0.35);
    --glow-red: 0 0 25px rgba(255, 0, 85, 0.35);
    --glow-gold: 0 0 25px rgba(255, 183, 3, 0.35);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Glow Effects */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
}

.bg-glow-1 {
    top: -15%;
    left: -15%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--primary-purple), transparent);
}

.bg-glow-2 {
    bottom: -15%;
    right: -15%;
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle, #0052d4, var(--primary-cyan), transparent);
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 80px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 28px;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-icon {
    width: 44px;
    height: 44px;
    font-size: 2.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 16px;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.5));
}

.brand-text {
    flex-shrink: 0;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Player Status Card */
.player-status-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-gold);
}

.level-badge {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-cyan));
    padding: 2px 10px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: var(--glow-purple);
}

.xp-bar-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.xp-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-cyan));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Step Panels */
.step-card {
    display: none;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--glass-shadow);
    animation: fadeIn 0.4s ease-in-out forwards;
}

.step-card.active {
    display: block;
}

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

.step-header {
    margin-bottom: 24px;
}

.step-badge {
    display: inline-block;
    background: rgba(0, 242, 254, 0.15);
    color: var(--primary-cyan);
    border: 1px solid var(--primary-cyan);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.step-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: #ffffff;
}

.step-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms & Controls */
.field-label {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.custom-textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
    transition: var(--transition-smooth);
    margin-bottom: 16px;
    resize: vertical;
}

.custom-textarea.sm {
    min-height: 70px;
}

.custom-textarea:focus {
    border-color: var(--primary-cyan);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 242, 254, 0.3);
}

/* Boss Card (攻撃目標) */
.boss-card {
    margin-top: 24px;
    background: linear-gradient(135deg, rgba(40, 10, 25, 0.9), rgba(15, 20, 35, 0.9));
    border: 2px solid var(--accent-red);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--glow-red);
    animation: bossPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bossPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.boss-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.boss-tag {
    background: var(--accent-red);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.boss-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
}

.boss-body {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.boss-visual {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 0, 85, 0.4);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.2);
}

.boss-avatar {
    font-size: 5rem;
    filter: drop-shadow(0 0 8px rgba(255, 0, 85, 0.4));
}

.boss-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.boss-flavor {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.boss-weakness-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.weakness-badge {
    color: var(--accent-gold);
    font-weight: 700;
    margin-left: 6px;
}

.boss-hp-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hp-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-red);
}

.hp-track {
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 0, 85, 0.3);
}

.hp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-orange));
    transition: width 0.6s ease;
}

/* Types Grid (STEP 2) */
.types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.type-card {
    background: rgba(10, 15, 25, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.type-card:hover {
    background: rgba(20, 30, 50, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px);
}

.type-card.selected-type {
    border-color: var(--primary-cyan);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(157, 78, 221, 0.15));
    box-shadow: var(--glow-cyan);
}

.type-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-icon {
    font-size: 1.8rem;
}

.type-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
}

.type-target {
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.type-structure {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.type-structure ol {
    padding-left: 18px;
    margin-top: 4px;
}

.type-structure li {
    margin-bottom: 2px;
}

.type-effect {
    font-size: 0.8rem;
    color: var(--primary-cyan);
    background: rgba(0, 242, 254, 0.08);
    padding: 8px 10px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-cyan);
}

/* 🌟 ユーザー指示：視覚整理パネル (Visual Guide Panel) */
.visual-guide-panel {
    background: linear-gradient(135deg, rgba(15, 25, 45, 0.9), rgba(5, 10, 20, 0.95));
    border: 1px solid var(--primary-cyan);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: inset 0 0 20px rgba(0, 242, 254, 0.08);
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.guide-icon {
    font-size: 1.4rem;
}

.guide-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary-cyan);
}

.guide-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.guide-flow-card {
    background: rgba(20, 30, 50, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.guide-step-tag {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
}

.tag-hook { background: rgba(255, 123, 0, 0.2); color: var(--accent-orange); border: 1px solid var(--accent-orange); }
.tag-empathy { background: rgba(255, 0, 127, 0.2); color: #ff007f; border: 1px solid #ff007f; }
.tag-insight { background: rgba(0, 242, 254, 0.2); color: var(--primary-cyan); border: 1px solid var(--primary-cyan); }
.tag-action { background: rgba(0, 255, 157, 0.18); color: var(--accent-green); border: 1px solid var(--accent-green); text-shadow: 0 0 8px rgba(0, 255, 157, 0.3); }

.guide-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
}

.guide-card-reason {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Craft Workspace */
.craft-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.craft-panel {
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.craft-panel h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
}

.panel-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Perspective Tabs */
.perspective-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.p-tab {
    padding: 6px 12px;
    background: rgba(20, 30, 50, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.p-tab:hover {
    background: rgba(30, 45, 75, 0.8);
    color: var(--text-main);
}

.p-tab.active {
    background: linear-gradient(135deg, #0055ff, #00a8ff);
    color: #ffffff !important;
    border-color: #00f2fe;
    box-shadow: 0 0 14px rgba(0, 168, 255, 0.45);
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* ネタ探しヒント (Topic Hints) */
.topic-hint-details {
    background: rgba(28, 36, 56, 0.7);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.topic-hint-details summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: bold;
    color: var(--primary-cyan);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.topic-hint-details summary::-webkit-details-marker {
    display: none;
}

.topic-hint-details summary::after {
    content: "▼";
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.topic-hint-details[open] summary::after {
    transform: rotate(180deg);
}

.topic-hint-content {
    padding: 0 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 4px;
}

.hint-item {
    margin-top: 12px;
    font-size: 0.9rem;
}

.hint-item strong {
    color: var(--accent-gold);
    display: block;
    margin-bottom: 4px;
}

.hint-item p {
    color: var(--text-main);
    line-height: 1.5;
    margin-left: 12px;
    position: relative;
}

.hint-item p::before {
    content: "・";
    position: absolute;
    left: -12px;
    color: var(--text-muted);
}

/* Question Box */
.question-box {
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--primary-cyan);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.q-badge {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-cyan);
}

.q-text {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 4px 0;
    color: #ffffff;
}

.q-reason {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Crafted Deck */
.crafted-deck-box {
    margin-top: 10px;
}

.crafted-deck-box h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.crafted-deck {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.speech-card {
    background: rgba(25, 35, 55, 0.8);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-cyan);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.speech-card:hover {
    background: rgba(35, 50, 80, 0.95);
    border-color: var(--primary-cyan);
    transform: translateX(4px);
}

.card-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.card-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.card-body {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Spell Assembly Panel */
.spell-assembly-panel {
    border-color: var(--primary-purple);
    background: linear-gradient(135deg, rgba(20, 15, 35, 0.7), rgba(10, 12, 22, 0.85));
}

.spell-power-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(157, 78, 221, 0.4);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spell-power-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
}

.power-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--primary-purple);
}

.spell-power-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.spell-power-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-cyan));
    border-radius: 6px;
    transition: width 0.4s ease;
}

.spell-slots {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.slot-container {
    background: rgba(10, 15, 25, 0.7);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    transition: var(--transition-smooth);
}

.slot-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.slot-badge {
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.slot-dropzone {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-placeholder {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    font-weight: 800;
    box-shadow: 0 0 22px rgba(0, 114, 255, 0.5);
    border: 1px solid rgba(0, 242, 254, 0.6);
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    color: #ffffff !important;
    box-shadow: 0 0 30px rgba(0, 198, 255, 0.7);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green), #20bf6b);
    color: #050b14;
    box-shadow: 0 0 20px rgba(46, 196, 182, 0.3);
}

.btn-success:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn.disabled, .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none !important;
    box-shadow: none !important;
}

.step-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

/* Breakthrough Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.breakthrough-modal-card {
    background: var(--bg-card);
    border: 2px solid var(--primary-cyan);
    border-radius: 24px;
    padding: 32px;
    max-width: 560px;
    width: 90%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 0 60px rgba(0, 242, 254, 0.35);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.defeat-banner {
    background: linear-gradient(135deg, rgba(46, 196, 182, 0.2), rgba(0, 242, 254, 0.1));
    border: 1px solid var(--accent-green);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.defeat-text {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--accent-green);
    display: block;
    margin-bottom: 4px;
}

.final-spell-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.final-spell-box h4 {
    font-size: 0.9rem;
    color: var(--primary-cyan);
    margin-bottom: 10px;
}

.final-spell-item {
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--primary-purple);
    font-size: 0.85rem;
}

.learning-summary-box {
    background: rgba(157, 78, 221, 0.1);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 12px;
    padding: 14px;
}

.learning-summary-box h4 {
    font-size: 0.85rem;
    color: var(--primary-purple);
    margin-bottom: 6px;
}

.learning-summary-box ul {
    padding-left: 18px;
    font-size: 0.8rem;
    color: var(--text-main);
}

.learning-summary-box li {
    margin-bottom: 4px;
}

/* Utilities */
.hidden { display: none !important; }
.placeholder-text { font-size: 0.8rem; color: var(--text-dim); text-align: center; font-style: italic; }

@media (max-width: 868px) {
    .types-grid, .craft-workspace {
        grid-template-columns: 1fr;
    }
    .boss-body {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   追加コンポーネント: 無料枠カウンター & 定型ボス選択
   ========================================================================== */

.trial-counter-badge {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.trial-count {
    font-size: 1.1rem;
    font-weight: 800;
}

.preset-boss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.preset-btn {
    text-align: left;
    padding: 0.8rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    white-space: normal;
    height: auto;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--neon-purple);
    background: rgba(157, 78, 221, 0.1);
    transform: translateY(-2px);
}

.divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.divider-text::before, .divider-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider-text::before { margin-right: 1em; }
.divider-text::after { margin-left: 1em; }

/* -------------------------------------
   Armory Modal (マイ武器庫)
   ------------------------------------- */
.armory-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.armory-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--primary-cyan);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow), var(--glow-cyan);
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.armory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(10, 15, 25, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.btn-close {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 2rem; cursor: pointer;
}
.btn-close:hover { color: #fff; }

.armory-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
}

.a-tab {
    padding: 12px 24px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 3px solid transparent;
}
.a-tab.active {
    color: var(--primary-cyan);
    border-bottom-color: var(--primary-cyan);
    background: rgba(0, 242, 254, 0.1);
}

.armory-body {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.armory-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 24px;
    overflow-y: auto;
    display: none;
}
.armory-view.active { display: block; }

.armory-list {
    display: flex; flex-direction: column; gap: 16px;
}
.armory-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
}

.armory-item-card {
    background: rgba(20, 30, 50, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.item-header { display: flex; justify-content: space-between; margin-bottom: 8px;}
.type-tag { font-size: 0.75rem; color: var(--primary-cyan); background: rgba(0, 242, 254, 0.1); padding: 2px 6px; border-radius: 4px;}
.item-date { font-size: 0.8rem; color: var(--text-muted); }

/* ==========================================================================
   追加コンポーネント: バトルアニメーション & 評価UI
   ========================================================================== */

/* Battle Animations */
.battle-flash {
    animation: flashBg 0.15s infinite alternate;
}

@keyframes flashBg {
    0% { background-color: var(--bg-dark); }
    100% { background-color: rgba(255, 0, 85, 0.2); }
}

.boss-shake {
    animation: shakeCard 0.2s infinite;
    border-color: #ff0000 !important;
    box-shadow: 0 0 40px #ff0000 !important;
}

@keyframes shakeCard {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-8px, 4px) rotate(-2deg); }
    50% { transform: translate(8px, -4px) rotate(2deg); }
    75% { transform: translate(-4px, -8px) rotate(-1deg); }
    100% { transform: translate(4px, 8px) rotate(1deg); }
}

/* Purify Animation */
#boss-defeat-overlay {
    transition: background 0.8s ease;
}

#boss-defeat-overlay.fade-white {
    background: rgba(255, 255, 255, 1) !important;
}

.boss-purify {
    animation: purifyEffect 2s forwards;
}

@keyframes purifyEffect {
    0% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 0 white); opacity: 1; }
    30% { transform: scale(1.1) rotate(3deg); filter: brightness(2) drop-shadow(0 0 40px red); opacity: 1; }
    60% { transform: scale(0.9) rotate(-3deg); filter: brightness(4) drop-shadow(0 0 100px white); opacity: 0.8; }
    100% { transform: scale(1.5); filter: brightness(10) blur(20px); opacity: 0; }
}

.text-breakthrough-pop {
    animation: textPop 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes textPop {
    0% { transform: scale(0); opacity: 0; }
    20% { transform: scale(1.2); opacity: 1; }
    80% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0; }
}

/* Evaluation UI */
.evaluation-box {
    margin-top: 16px;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 20px;
}

.evaluation-box h4 {
    font-size: 1rem;
    color: var(--primary-cyan);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eval-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.eval-metric-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
}

.metric-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.metric-fill.empathy { background: linear-gradient(90deg, #ff007f, #ff7b00); }
.metric-fill.logic { background: linear-gradient(90deg, #0052d4, #00f2fe); }
.metric-fill.passion { background: linear-gradient(90deg, #ffb703, #ff0055); }

.eval-feedback-text {
    font-size: 0.9rem;
    color: var(--text-main);
    background: rgba(0, 242, 254, 0.1);
    border-left: 4px solid var(--primary-cyan);
    padding: 12px;
    border-radius: 0 8px 8px 0;
    line-height: 1.5;
}

/* ==========================================================================
   Visual Feedback Animations
   ========================================================================== */

/* Pop-in animation for newly crafted cards */
@keyframes popIn {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; }
    70% { transform: scale(1.05) translateY(-5px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.anim-pop-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.6);
}

/* Flash highlight for placing card in slot */
@keyframes flashHighlight {
    0% { box-shadow: inset 0 0 0 2px transparent, 0 0 0 transparent; background: transparent; }
    50% { box-shadow: inset 0 0 0 2px var(--primary-cyan), 0 0 20px var(--primary-cyan); background: rgba(0, 242, 254, 0.1); }
    100% { box-shadow: inset 0 0 0 2px transparent, 0 0 0 transparent; background: transparent; }
}

.anim-flash-highlight {
    animation: flashHighlight 1.5s ease-out;
}

/* ==========================================================================
   Responsive Design (Mobile / Tablet)
   ========================================================================== */

/* デスクトップ向けのボタン群レイアウト（デフォルト） */
.armory-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}
.armory-controls .trial-badge {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-main);
}
.armory-controls .unlock-btn { padding: 8px 16px; font-size: 0.85rem; border-color: var(--accent-gold); color: var(--accent-gold); }
.armory-controls .armory-btn { padding: 8px 16px; font-size: 0.85rem; }
.armory-controls .login-btn { padding: 8px 16px; font-size: 0.85rem; }

/* スマホ・タブレット向け（768px以下） */
@media (max-width: 768px) {
    .app-container {
        padding: 10px 12px 60px;
    }

    /* ヘッダーの縦積み化 */
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }
    .brand {
        justify-content: center;
    }
    .brand-icon {
        width: 40px;
        height: 40px;
        font-size: 1.9rem;
        margin-right: 14px;
        flex-shrink: 0;
    }
    .brand-text h1 {
        font-size: 1.35rem;
        white-space: nowrap;
    }
    .player-status-card {
        min-width: 100%;
    }
    .armory-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    .armory-controls .btn {
        flex: 1;
        min-width: 140px;
        text-align: center;
    }

    /* ボタングリッドの1列化とサイズ最適化 */
    .preset-boss-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .preset-btn {
        padding: 14px 16px;
        font-size: 1rem;
        position: relative;
        z-index: 10;
        cursor: pointer;
    }

    /* ステップカードの余白調整 */
    .step-card {
        padding: 20px 16px;
    }
    .step-header h2 {
        font-size: 1.3rem;
    }
    
    /* 入力フォームの高さとパディング調整 */
    .custom-textarea {
        min-height: 120px;
        font-size: 1rem;
    }
    
    /* モーダルダイアログの調整 */
    .modal-card {
        width: 95%;
        padding: 20px;
    }
    
    .final-spell-content {
        padding: 16px;
    }
    .final-spell-box h4 {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   ⚖️ フッター ＆ リーガル（規約・特商法）モーダル スタイル
   ========================================================================== */
.app-footer {
    margin-top: 60px;
    padding: 30px 20px 40px;
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(10px);
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: var(--primary-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.footer-link-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    font-size: 0.85rem;
    color: #a0aec0;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: inherit;
}

.footer-link-btn:hover {
    color: var(--primary-cyan);
    text-decoration: underline;
}

.footer-sep {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.2);
}

/* リーガルモーダル */
.legal-modal-card {
    max-width: 680px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #0d1117;
    border: 1px solid var(--primary-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    overflow: hidden;
}

.legal-modal-card .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    flex-shrink: 0; /* 縮み防止 */
}

.legal-tabs-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    flex-shrink: 0; /* 縮み防止：下の長文に押し潰されないように固定 */
    min-height: 48px; /* タブバーの高さをしっかり確保 */
}

.legal-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    height: 100%;
    box-sizing: border-box;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    line-height: 1;
}

.legal-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.legal-tab-btn.active {
    color: var(--primary-cyan);
    border-bottom-color: var(--primary-cyan);
    background: rgba(0, 240, 255, 0.08);
}

.legal-modal-body {
    padding: 24px 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #e2e8f0;
}

.legal-tab-content h4 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 1.05rem;
    color: var(--primary-cyan);
}

.legal-tab-content h5 {
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #fff;
}

.legal-tab-content p {
    margin-bottom: 12px;
    color: #cbd5e1;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.legal-table th,
.legal-table td {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    vertical-align: top;
}

.legal-table th {
    width: 28%;
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    text-align: left;
    white-space: nowrap;
}

.legal-table td {
    background: rgba(0, 0, 0, 0.2);
    color: #f1f5f9;
}

@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    .footer-links {
        justify-content: center;
        gap: 6px;
    }
    .footer-sep {
        display: none;
    }
    .footer-link-btn {
        padding: 4px 8px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: 4px;
        margin: 2px;
        font-size: 0.78rem;
    }
    .legal-table th,
    .legal-table td {
        display: block;
        width: 100%;
    }
    .legal-table th {
        border-bottom: none;
        background: rgba(0, 240, 255, 0.1);
        color: var(--primary-cyan);
    }
    .legal-tabs-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    .legal-tab-btn {
        padding: 10px 4px;
        font-size: 0.8rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

/* ==========================================================================
   🌅 朝礼・1分スピーチ用 お助けネタリスト スタイル
   ========================================================================== */
.morning-topic-container {
    animation: fadeInGlow 0.4s ease-out;
}

.morning-topic-container summary {
    list-style: none;
}

.morning-topic-container summary::-webkit-details-marker {
    display: none;
}

.morning-topic-container .morning-toggle-badge {
    font-size: 0.72rem;
    color: #ffb74d;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.35);
    border-radius: 4px;
    padding: 2px 7px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.morning-topic-container:not([open]) .morning-toggle-badge {
    color: #bbb;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.morning-topic-container[open] .morning-toggle-badge::before {
    content: "▲ たたむ";
}

.morning-topic-container:not([open]) .morning-toggle-badge::before {
    content: "▼ ひらく";
}

@keyframes fadeInGlow {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.morning-topic-card {
    position: relative;
    overflow: hidden;
}

.morning-topic-card:hover {
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
    transform: translateY(-2px);
}

.morning-topic-card .btn-apply-topic:hover {
    filter: brightness(1.2);
}

@media (max-width: 600px) {
    .morning-topic-grid {
        grid-template-columns: 1fr !important;
    }
}

