/* ============================================================================
   Bouldering Passport — Stylesheet
   ============================================================================
   目次 (Table of Contents)
   --------------------------------------------------------------------------
   1.  Design Tokens (カスタムプロパティ)
   2.  Reset & Base
   3.  App Shell
   4.  Header
   5.  Main Content & Animation
   6.  Hero Card
   7.  Typography
   8.  Buttons
   9.  Climbing Path (課題パス)
   10. Badge Grid (バッジ一覧)
   11. Badge Rarity Animations (レア度エフェクト)
   12. Decorative Elements
   13. Bottom Navigation
   14. Nav Icons
   15. Utility
   16. Modal (共通)
   17. Modal — Skill Check Row
   18. Drag & Drop (課題マスター)
   19. Teacher View — Form / Card
   20. Category Tabs
   21. Toast Notification
   22. Matrix Table (マトリックス入力)
   ========================================================================== */


/* ==========================================================================
   1. Design Tokens
   ========================================================================== */

:root {
    /* ---- Palette ---- */
    --paper:       #F9F9F6;
    --ink:         #111111;
    --blob-red:    #FF4D26;
    --blob-yellow: #FFD600;
    --blob-blue:   #007AFF;
    --blob-green:  #50C878;
    --blob-pink:   #FF69B4;
    --blob-orange: #FF8C42;

    /* ---- Patterns ---- */
    --scribble-dark: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M-1,1 l2,-2 M0,10 l10,-10 M9,11 l2,-2' stroke='%23111' stroke-width='1'/%3E%3C/svg%3E");
    --dots-pattern:  radial-gradient(#111 20%, transparent 20%);

    /* ---- Typography ---- */
    --font-display: 'M PLUS Rounded 1c', sans-serif;
    --font-body:    'M PLUS Rounded 1c', monospace;
}


/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--font-display);
    overflow-x: hidden;
}


/* ==========================================================================
   3. App Shell
   ========================================================================== */

.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--paper);
}


/* ==========================================================================
   4. Header
   ========================================================================== */

header {
    padding: 24px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* ---- Brand Logo ---- */
.brand-mark {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.1;
    position: relative;
    z-index: 2;
}

.brand-mark::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -5px;
    width: 110%;
    height: 8px;
    background: var(--blob-blue);
    border-radius: 4px;
    transform: rotate(-1deg);
    opacity: 0.4;
    z-index: -1;
}

/* ---- Profile Avatar ---- */
.profile-avatar {
    width: 48px;
    height: 48px;
    background: var(--blob-yellow);
    border: 2px solid var(--ink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 24px;
}

.profile-avatar::before {
    content: '|||';
    font-family: monospace;
    font-weight: bold;
    font-size: 10px;
    position: absolute;
    top: -10px;
    left: 12px;
    transform: rotate(-10deg);
    letter-spacing: 3px;
}

/* ---- Doodle Eye (avatar detail) ---- */
.doodle-eye {
    width: 24px;
    height: 14px;
    border: 2px solid var(--ink);
    border-radius: 70% 15%;
    transform: rotate(45deg);
    position: relative;
    background: white;
    overflow: hidden;
}

.doodle-eye::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--blob-green);
    border: 1px solid var(--ink);
    border-radius: 50%;
    top: 2px;
    left: 6px;
}

/* ---- Brush Accent ---- */
.brush-accent {
    position: absolute;
    top: 40px;
    left: 140px;
    width: 60px;
    height: 12px;
    background: black;
    mask:         url("data:image/svg+xml,%3Csvg preserveAspectRatio='none' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,10 Q50,0 100,10 L90,15 Q50,5 10,15 Z' fill='black'/%3E");
    -webkit-mask: url("data:image/svg+xml,%3Csvg preserveAspectRatio='none' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,10 Q50,0 100,10 L90,15 Q50,5 10,15 Z' fill='black'/%3E");
}


/* ==========================================================================
   5. Main Content & Animation
   ========================================================================== */

main {
    flex: 1;
    padding: 20px 20px 120px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    animation: fadeIn 0.4s ease-out;
}

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


/* ==========================================================================
   6. Hero Card
   ========================================================================== */

.hero-card {
    background: white;
    border: 2px solid var(--ink);
    border-radius: 20px 24px 18px 22px;
    padding: 24px;
    position: relative;
    box-shadow: 4px 4px 0 var(--ink);
    overflow: hidden;
}

/* ---- Background Blobs ---- */
.hero-bg-blob {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: var(--blob-red);
    opacity: 0.2;
    border-radius: 40% 60% 30% 70%;
    z-index: 0;
}

.hero-bg-blob.blue  { background: var(--blob-blue); }
.hero-bg-blob.green { background: var(--blob-green); opacity: 0.15; }

.hero-content {
    position: relative;
    z-index: 1;
}


/* ==========================================================================
   7. Typography
   ========================================================================== */

.label-pill {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 900;
    background: var(--blob-yellow);
    padding: 4px 12px;
    border-radius: 12px;
    border: 2px solid var(--ink);
    margin-bottom: 12px;
}

h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
}

p {
    margin: 0 0 20px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    color: #444;
}

.path-title {
    font-family: var(--font-body);
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 1px;
    font-size: 14px;
    color: var(--ink);
    display: block;
    text-align: center;
    border-bottom: 2px dashed var(--ink);
    padding-bottom: 10px;
    margin-bottom: 24px;
}


/* ==========================================================================
   8. Buttons
   ========================================================================== */

.action-btn {
    background: var(--ink);
    color: white;
    border: none;
    padding: 12px 24px;
    font-family: var(--font-display);
    font-weight: bold;
    font-size: 16px;
    border-radius: 30px 20px 25px 35px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s;
}

.action-btn:active {
    transform: scale(0.95);
}


/* ==========================================================================
   9. Climbing Path (課題パス)
   ========================================================================== */

.climb-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    position: relative;
}

/* パスの中央ライン */
.climb-path::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 50%;
    width: 2px;
    border-left: 2px dashed var(--ink);
    opacity: 0.3;
    z-index: 0;
}

/* ---- Hold Wrapper (統合済み) ----
   ※ 元ファイルでは .hold-wrapper が2箇所で宣言されていたため統合 */
.hold-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
}

.hold-wrapper:nth-child(odd)  { justify-content: flex-start; padding-left: 10%; }
.hold-wrapper:nth-child(even) { justify-content: flex-end;   padding-right: 10%; }

/* ---- Climbing Hold ---- */
.climb-hold {
    width: 80px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    color: var(--ink);
    border: 2px solid var(--ink);
    position: relative;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 1);
    transition: transform 0.2s;
    order: 1;
}

.climb-hold:active { transform: scale(0.95); }

/* Hold color variations */
.hold-1 { background: var(--blob-red);   border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.hold-2 { background: var(--blob-green); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
.hold-3 { background: var(--blob-blue);  border-radius: 40% 60% 30% 70% / 50% 60% 40% 50%; color: white; }

.hold-locked {
    background: white;
    background-image: var(--scribble-dark);
    background-size: 6px 6px;
    color: var(--ink);
    font-weight: 900;
    border-radius: 50%;
}

/* ---- Hold Label ---- */
.hold-label {
    position: relative;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.3;
    max-width: 150px;
    word-break: break-all;
    background: var(--paper);
    border: 2px solid var(--ink);
    padding: 4px 8px;
    border-radius: 10px;
    box-shadow: 2px 2px 0 var(--ink);
    z-index: 2;
}

/* Label position depends on row parity */
.hold-wrapper:nth-child(odd) .hold-label  { order: 2; text-align: left; }
.hold-wrapper:nth-child(even) .hold-label { order: 0; text-align: right; }


/* ==========================================================================
   10. Badge Grid (バッジ一覧)
   ========================================================================== */

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

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: transform 0.2s;
}

.badge-item:active { transform: scale(0.95); }

.badge-icon-wrapper {
    width: 70px;
    height: 70px;
    background: var(--blob-yellow);
    border: 3px solid var(--ink);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 0 var(--ink);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.badge-item:not(.locked):hover .badge-icon-wrapper {
    transform: scale(1.05) rotate(5deg);
}

.badge-icon {
    font-size: 2rem;
    position: relative;
    z-index: 2;
}

/* Locked state */
.badge-item.locked .badge-icon-wrapper {
    background: var(--paper);
    background-image: var(--scribble-dark);
    background-size: 5px 5px;
    box-shadow: 2px 2px 0 var(--ink) inset;
    border: 2px dashed var(--ink);
    opacity: 0.6;
}

.badge-item.locked .badge-name { color: #999; }

.badge-name {
    font-weight: 900;
    font-size: 11px;
    line-height: 1.2;
    color: var(--ink);
}


/* ==========================================================================
   11. Badge Rarity Animations (レア度エフェクト)
   ========================================================================== */

/* Bronze */
.rarity-bronze .badge-icon-wrapper {
    background: linear-gradient(135deg, #FFB97A, #CC7A33);
    border-color: #8B4513;
    box-shadow: 3px 3px 0 #8B4513;
}

/* Silver */
.rarity-silver .badge-icon-wrapper {
    background: linear-gradient(135deg, #F0F4F8, #A0B2C6);
    border-color: #556B8D;
    box-shadow: 3px 3px 0 #556B8D;
}

/* Gold — gentle bounce */
.rarity-gold .badge-icon-wrapper {
    background: linear-gradient(135deg, #FFF0A8, #FFC107);
    border-color: #B28704;
    box-shadow: 3px 3px 0 #B28704;
    animation: bounce-gentle 3s infinite ease-in-out;
}

/* Platinum — shine sweep */
.rarity-platinum .badge-icon-wrapper {
    background: linear-gradient(135deg, #E5E4E2, #FFFFFF, #B4B4B4);
    background-size: 200% 200%;
    border-color: #8C8C8C;
    box-shadow: 3px 3px 0 #8C8C8C, 0 0 10px rgba(229, 228, 226, 0.8);
    animation: shine-platinum 3s infinite linear;
}

/* Diamond — rainbow pulse */
.rarity-diamond .badge-icon-wrapper {
    background: linear-gradient(135deg, #FF9EBB, #FF3366, #b033ff, #33ccff);
    background-size: 300% 300%;
    border-color: #fff;
    box-shadow: 3px 3px 0 #990026, 0 0 20px rgba(255, 51, 102, 0.8);
    animation: shine-diamond 3s infinite ease-in-out;
}

/* ---- Keyframes ---- */

@keyframes bounce-gentle {
    0%, 100% { transform: translateY(-2px); }
    50%      { transform: translateY(-6px); }
}

@keyframes shine-platinum {
    0%   { background-position: 0% 50%;   filter: brightness(1); }
    50%  { background-position: 100% 50%; filter: brightness(1.1); transform: translateY(-3px); }
    100% { background-position: 0% 50%;   filter: brightness(1); }
}

@keyframes shine-diamond {
    0%   { background-position: 0% 50%;   transform: scale(1); }
    50%  { background-position: 100% 50%; transform: scale(1.1) rotate(5deg); box-shadow: 0 0 30px rgba(51, 204, 255, 0.9); }
    100% { background-position: 0% 50%;   transform: scale(1); }
}


/* ==========================================================================
   12. Decorative Elements
   ========================================================================== */

.deco-dots {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: var(--dots-pattern);
    background-size: 8px 8px;
    border-radius: 50%;
    z-index: 0;
}

.deco-star {
    position: absolute;
    color: var(--blob-pink);
    font-size: 40px;
    font-weight: 100;
    line-height: 0;
    z-index: 0;
}


/* ==========================================================================
   13. Bottom Navigation
   ========================================================================== */

nav.bottom-nav {
    position: fixed;
    bottom: 24px;
    left: 20px;
    right: 20px;
    max-width: 440px;
    margin: 0 auto;
    height: 64px;
    background: var(--ink);
    border-radius: 40px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.nav-item {
    width: 80px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 28px;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item.active { background: var(--paper); }

.nav-label {
    font-size: 10px;
    font-weight: 900;
    color: white;
}

.nav-item.active .nav-label { color: var(--ink); }


/* ==========================================================================
   14. Nav Icons (Pure CSS)
   ========================================================================== */

.icon {
    width: 22px;
    height: 22px;
    border: 2px solid white;
}

/* ---- User Icon ---- */
.icon-user {
    border-radius: 4px 4px 12px 12px;
    position: relative;
}

.icon-user::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 4px;
    width: 10px;
    height: 10px;
    border: 2.5px solid white;
    border-radius: 50%;
}

.active .icon-user,
.active .icon-user::before {
    border-color: var(--ink);
    background: var(--blob-pink);
}

/* ---- Map / Teacher Icon ---- */
.icon-map {
    border-radius: 50%;
    position: relative;
}

.icon-map::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2.5px solid white;
}

.active .icon-map         { border-color: var(--ink); background: var(--blob-green); }
.active .icon-map::after  { border-color: var(--ink); }

/* ---- Chart / Stats Icon ---- */
.icon-chart {
    border: none;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    border-radius: 2px;
    position: relative;
    background: transparent;
}

.icon-chart::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 2px;
    width: 4px;
    height: 6px;
    background: white;
    box-shadow: 6px -4px 0 white, 12px -8px 0 white;
}

.active .icon-chart        { border-color: var(--ink); background: var(--paper); }
.active .icon-chart::after { background: var(--ink); box-shadow: 6px -4px 0 var(--ink), 12px -8px 0 var(--ink); }


/* ==========================================================================
   15. Utility
   ========================================================================== */

.loading {
    text-align: center;
    font-weight: 900;
    font-size: 1.2rem;
    margin-top: 50px;
}

.hidden {
    /* JS から制御される汎用非表示クラス (modal-overlay.hidden は別途定義) */
}


/* ==========================================================================
   16. Modal (共通)
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;                                  /* top/right/bottom/left: 0 のショートハンド */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--paper);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    border: 3px solid var(--ink);
    border-radius: 20px;
    box-shadow: 8px 8px 0 var(--ink);
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: translateY(30px);
}

.modal-header {
    background: var(--blob-green);
    color: var(--ink);
    padding: 15px 20px;
    border-bottom: 3px solid var(--ink);
    border-radius: 17px 17px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-weight: 900;
    font-size: 1.2rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    color: var(--ink);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 2px dashed var(--ink);
    background: white;
    border-radius: 0 0 17px 17px;
}


/* ==========================================================================
   17. Modal — Skill Check Row
   ========================================================================== */

.modal-skill-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid var(--ink);
    box-shadow: 2px 2px 0 var(--ink);
    cursor: pointer;
}

.modal-skill-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    accent-color: var(--blob-pink);
    cursor: pointer;
}

.modal-skill-row label {
    font-family: var(--font-body);
    font-weight: 900;
    font-size: 14px;
    flex: 1;
    cursor: pointer;
}


/* ==========================================================================
   18. Drag & Drop (課題マスター)
   ========================================================================== */

.drag-handle {
    cursor: grab;
    color: var(--ink);
    opacity: 0.5;
    padding: 0 10px;
    font-size: 16px;
    user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.sortable-ghost { opacity: 0.4; background-color: #f0f0f0; }

.sortable-drag {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.02);
}

.skill-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 2px solid var(--ink);
    border-radius: 8px;
    padding: 8px 5px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.skill-list-item:hover { box-shadow: 2px 2px 0 var(--ink); }

.skill-title-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    font-size: 14px;
    font-family: inherit;
    font-weight: bold;
}


/* ==========================================================================
   19. Teacher View — Form / Card
   ========================================================================== */

.class-selector {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--ink);
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
    color: var(--ink);
    background-color: var(--paper);
    outline: none;
    appearance: none;
    box-shadow: 3px 3px 0 var(--ink);
    margin-bottom: 20px;
}

.student-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border: 2px solid var(--ink);
    border-radius: 15px 25px 20px 15px;
    box-shadow: 3px 3px 0 var(--ink);
    margin-bottom: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.1s;
}

.student-card:active { transform: scale(0.98); }

.student-card .status {
    background: var(--blob-yellow);
    border: 2px solid var(--ink);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}


/* ==========================================================================
   20. Category Tabs
   ========================================================================== */

.category-tabs {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
    background: white;
    padding: 6px;
    border: 2px solid var(--ink);
    border-radius: 15px;
    box-shadow: 3px 3px 0 var(--ink);
}

.category-tab {
    flex: 1;
    padding: 10px 5px;
    border: 2px solid transparent;
    background: transparent;
    color: var(--ink);
    font-weight: 900;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    outline: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-tab:not(.tab-active) {
    border: 2px dashed #ccc;
    opacity: 0.7;
}

.category-tab.tab-active {
    background: var(--blob-blue);
    color: white;
    border: 2px solid var(--ink);
    box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    opacity: 1;
}

.category-tab:active { transform: translateY(0); }


/* ==========================================================================
   21. Toast Notification
   ========================================================================== */

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: var(--ink);
    color: white;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 14px;
    padding: 12px 20px;
    border: 2px solid white;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    white-space: pre-wrap;
    animation:
        toast-slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        toast-fade-out 0.3s ease-in 2s forwards;
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-20px); }
}


/* ==========================================================================
   22. Matrix Table (マトリックス入力)
   ========================================================================== */

.matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 13px;
    font-weight: 900;
}

.matrix-table th,
.matrix-table td {
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    white-space: nowrap;
}

.matrix-table th {
    background: #f0f0f0;
    border-top: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Sticky first column (name / level) */
.matrix-table td.matrix-name-col,
.matrix-table th.matrix-name-col {
    position: sticky;
    left: 0;
    background: #fff;
    border-right: 2px solid var(--ink);
    text-align: left;
    min-width: 120px;
    z-index: 11;
}

.matrix-table th.matrix-name-col {
    background: #e0e0e0;
    z-index: 12;   /* sticky header + sticky column の交差セル */
}

.matrix-checkbox {
    width: 22px;
    height: 22px;
    accent-color: var(--blob-green);
    cursor: pointer;
}