/* Grimbits Organiser - Sushi Buffet results-page lookup panel.
   Same parchment + gold language as Sushi Buffet, with airy spacing. */

.gol-panel {
    margin-top: 2.25rem !important;
    margin-bottom: 1.5rem !important;
    background: rgba(20, 14, 8, 0.55);
    border: 1px solid #4a382a;
    border-radius: 8px;
    color: #f3e6c8;
    font-family: 'Crimson Text', Georgia, serif;
    overflow: hidden;
    display: block;
}
.gol-summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.2rem !important;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #C9A84C;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    user-select: none;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid transparent;
    transition: border-color 150ms;
}
.gol-summary::-webkit-details-marker { display: none; }
.gol-panel[open] .gol-summary { border-bottom-color: #251E15; }
.gol-summary-label { flex: 1; }
.gol-summary-count {
    font-size: 0.85rem;
    color: #D4C4A0;
    font-style: italic;
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    letter-spacing: 0;
    flex-shrink: 0;
}

.gol-body { padding: 1.4rem 1.4rem 1.5rem !important; }
.gol-intro {
    color: #c2b497;
    font-style: italic;
    font-size: 0.9rem;
    margin: 0 0 1rem !important;
    line-height: 1.45;
}
.gol-status { font-size: 0.9rem; color: #c2b497; font-style: italic; }
.gol-status.gol-error { color: #d97755; }

/* ---------- Tray section (each tray is its own <details>) ---------- */
.gol-tray-section {
    margin-bottom: 0.7rem !important;
    background: rgba(0,0,0,0.18);
    border: 1px solid #251E15;
    border-radius: 6px;
    overflow: hidden;
}
.gol-tray-section:last-child { margin-bottom: 0 !important; }
.gol-tray-head {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem !important;
    background: linear-gradient(90deg, rgba(201,168,76,0.14), rgba(201,168,76,0.02));
    user-select: none;
}
.gol-tray-head::-webkit-details-marker { display: none; }
.gol-tray-section[open] .gol-tray-head { border-bottom: 1px solid #251E15; }
.gol-tray-num {
    font-family: 'Cinzel', serif;
    color: #C9A84C;
    font-size: 1rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    flex: 1;
    text-align: center;
}
.gol-tray-count {
    color: #D4C4A0;
    font-size: 0.8rem;
    font-style: italic;
}
.gol-tray-missing .gol-tray-head {
    background: linear-gradient(90deg, rgba(217,119,85,0.18), rgba(217,119,85,0.02));
}
.gol-tray-missing .gol-tray-num { color: #d97755; }

/* ---------- Tray grid (matches the layout builder) ---------- */
.gol-tray-grid-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem 0.7rem 1.1rem !important;
}
.gol-panel .go-grid,
.gol-panel .go-cell,
.gol-panel .go-disc,
.gol-panel .go-disc * { box-sizing: border-box; }
.gol-panel .go-disc { cursor: pointer; }
.gol-panel .go-disc[data-name]:hover { transform: scale(1.04); transition: transform 120ms; }

/* The layout builder sets `touch-action: none` on .go-grid + .go-cell + .go-disc
   so it can capture drag gestures. Inside the lookup panel there's no dragging,
   so the no-touch policy just blocks vertical page scroll once a tray is open
   on mobile. Restore vertical-scroll panning explicitly — this also covers the
   standalone Sushi Buffet draft tool, not just the .gol-org embed. */
.gol-panel .gol-tray-section,
.gol-panel .gol-tray-grid-wrap,
.gol-panel .go-grid,
.gol-panel .go-cell,
.gol-panel .go-disc { touch-action: pan-y !important; }
.gol-panel .gol-tray-head { touch-action: manipulation; }

/* Override edition colors with alignment colors inside the lookup panel —
   the storyteller doesn't care which set a token came from, only its team.
   Values match Sushi Buffet's --townsfolk/--outsider/--minion/--demon tokens
   so the panel sits visually inside the draft page. */
.gol-panel .go-disc[data-role="Townsfolk"] { --disc-bg: rgba(46,134,171,0.18); --disc-border: #2E86AB; --disc-text: #2E86AB; }
.gol-panel .go-disc[data-role="Outsider"]  { --disc-bg: rgba(78,205,196,0.18); --disc-border: #4ECDC4; --disc-text: #4ECDC4; }
.gol-panel .go-disc[data-role="Minion"]    { --disc-bg: rgba(232,93,93,0.20);  --disc-border: #E85D5D; --disc-text: #E85D5D; }
.gol-panel .go-disc[data-role="Demon"]     { --disc-bg: rgba(204,34,34,0.22);  --disc-border: #CC2222; --disc-text: #CC2222; }
/* Travellers + Fabled have no Sushi Buffet role tint — fall back to the
   panel's parchment + gold so they harmonize with the rest of the page. */
.gol-panel .go-disc[data-role="Traveller"] { --disc-bg: rgba(212,196,160,0.14); --disc-border: #D4C4A0; --disc-text: #D4C4A0; }
.gol-panel .go-disc[data-role="Fabled"]    { --disc-bg: rgba(201,168,76,0.16);  --disc-border: #C9A84C; --disc-text: #C9A84C; }

/* Extra (lookup-added) tokens — dashed gold ring + close badge, click to remove. */
.gol-panel .gol-extra-token { outline: 2px dashed #C9A84C; outline-offset: 3px; }
.gol-panel .gol-extra-token::before {
    content: '\00D7'; /* × */
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #C9A84C;
    color: #1a1410;
    border-radius: 50%;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    z-index: 3;
    pointer-events: none;
}

/* Pulse animation when a lookup token is freshly added. */
@keyframes gol-pulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    35% { transform: scale(1.22); filter: brightness(1.45) drop-shadow(0 0 10px #C9A84C); }
    70% { transform: scale(1); filter: brightness(1.1); }
}
.gol-panel .go-disc.gol-just-added {
    animation: gol-pulse 0.7s ease-out 3;
    z-index: 4;
}

/* ---------- Missing tokens ---------- */
.gol-missing-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem 0.9rem;
}
.gol-missing-pill {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border: 1px dashed #d97755;
    border-radius: 999px;
    color: #f3e6c8;
    font-size: 0.8rem;
    font-family: 'Crimson Text', Georgia, serif;
}

/* ---------- Extra-search list items ---------- */
.gol-item-loc {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #c9a961;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
}
.gol-item-loc.gol-missing {
    color: #d97755;
    font-style: italic;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.85rem;
}
.gol-slot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    background: #c9a961;
    color: #1a1410;
    border-radius: 50%;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ---------- Extra search ---------- */
.gol-extra {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #4a382a;
}
.gol-section-title {
    font-family: 'Cinzel', serif;
    color: #c9a961;
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.gol-extra-row { display: flex; gap: 0.5rem; align-items: center; }
.gol-extra-row input {
    flex: 1;
    background: #2a1f17;
    color: #f3e6c8;
    border: 1px solid #4a382a;
    border-radius: 4px;
    padding: 0.55rem 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
}
.gol-extra-row input:focus { outline: 2px solid #c9a961; outline-offset: 1px; }
.gol-extra-results {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    background: #2a1f17;
    border: 1px solid #4a382a;
    border-radius: 4px;
    max-height: 240px;
    overflow-y: auto;
}
.gol-extra-results:empty { display: none; }
.gol-extra-results li {
    padding: 0.5rem 0.7rem;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(74,56,42,0.55);
}
.gol-extra-results li:last-child { border-bottom: 0; }
.gol-extra-results li.gol-extra-clickable { cursor: pointer; }
.gol-extra-results li.gol-extra-clickable:hover { background: #3a2c20; }
.gol-extra-results li.gol-extra-clickable:hover .gol-item-loc { color: #f3e6c8; }
.gol-extra-results img {
    width: 32px; height: 32px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(201,169,97,0.4);
}

/* ---------- Logged-out CTA on setup phase ---------- */
.gol-cta {
    margin-top: 1.5rem;
    padding: 0.9rem 1.2rem;
    background: rgba(201,169,97,0.08);
    border: 1px dashed #c9a961;
    border-radius: 6px;
    color: #c2b497;
    font-size: 0.9rem;
    text-align: center;
    font-family: 'Crimson Text', Georgia, serif;
    line-height: 1.5;
}
.gol-cta a {
    color: #c9a961;
    text-decoration: underline;
    font-family: 'Cinzel', serif;
}
.gol-cta a:hover { color: #f3e6c8; }

@media (max-width: 540px) {
    .gol-summary { padding: 0.7rem 0.8rem; font-size: 0.95rem; }
    .gol-body { padding: 0.8rem; }
    .gol-tray-grid-wrap { padding: 0.7rem 0.3rem 0.8rem; }
    .gol-slot-badge { min-width: 28px; height: 28px; font-size: 0.85rem; }
}
