/* ============================================================================
   Replay note-capture HUD — RMB-hold opens a rectangular pad with 6 category
   cells. Drag-release on a cell morphs the SAME rectangle in-place into a
   note input (textarea + save). Mounted inside .canvas-wrapper by
   modules/replay/notes-radial.js.
   ============================================================================ */

.replay-radial-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 30;
    width: 0;
    height: 0;
}

.replay-radial-card {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 380px;
    height: 240px;
    transform: translate(-50%, -50%);
    background:
        linear-gradient(180deg, rgba(20, 24, 32, 0.78), rgba(10, 13, 20, 0.88));
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-radius: 14px;
    box-shadow:
        0 18px 56px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 0 1px rgba(86, 194, 255, 0.06);
    pointer-events: all;
    overflow: hidden;
    opacity: 0;
    animation: rri-card-in 200ms cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes rri-card-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.93); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* The 3×2 grid of category cells. Visible in selection mode. */
.replay-radial-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1px;
    background: rgba(255, 255, 255, 0.04);
    transition: opacity 220ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.replay-radial-card.morphed .replay-radial-grid {
    opacity: 0;
    pointer-events: none;
}

.replay-radial-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(20, 24, 32, 0.55);
    cursor: pointer;
    transition:
        background-color 140ms ease,
        box-shadow 140ms ease,
        transform 220ms cubic-bezier(0.2, 0.8, 0.25, 1);
    position: relative;
    --cell-color: #56c2ff;
    user-select: none;
}

.replay-radial-cell::before {
    /* Bottom color stripe — subtle category cue without dominating the cell. */
    content: '';
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 8px;
    height: 2px;
    background: var(--cell-color);
    border-radius: 1px;
    opacity: 0.35;
    transition: opacity 140ms ease, height 140ms ease;
}

.replay-radial-cell.hover {
    background: rgba(20, 24, 32, 0.35);
    box-shadow:
        0 0 0 1.5px var(--cell-color) inset,
        0 0 28px var(--cell-color) inset;
}

.replay-radial-cell.hover::before {
    opacity: 1;
    height: 3px;
}

.replay-radial-cell-icon {
    width: 28px;
    height: 28px;
    color: var(--text-dim, #aab3c2);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: color 140ms ease, transform 200ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.replay-radial-cell.hover .replay-radial-cell-icon {
    color: #fff;
    transform: scale(1.1);
}

.replay-radial-cell-label {
    font-family: var(--display, 'Rajdhani', sans-serif);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted, #6e7687);
    transition: color 140ms ease;
    white-space: nowrap;
}

.replay-radial-cell.hover .replay-radial-cell-label {
    color: #fff;
}

/* The note-input layer — fades in once a cell is committed. */
.replay-radial-input {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms cubic-bezier(0.2, 0.8, 0.25, 1) 80ms;
}

.replay-radial-card.morphed .replay-radial-input {
    opacity: 1;
    pointer-events: all;
}

.rri-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 6px;
}

.rri-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    font-family: var(--display, 'Rajdhani', sans-serif);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(86, 194, 255, 0.16);
    border: 1px solid var(--cell-color, #56c2ff);
    box-shadow: 0 0 16px rgba(86, 194, 255, 0.2) inset;
    --cell-color: #56c2ff;
}

.rri-pill-icon {
    width: 14px;
    height: 14px;
    color: var(--cell-color, #56c2ff);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rri-time {
    font-family: var(--mono, 'JetBrains Mono', monospace);
    font-size: 11px;
    color: var(--text-dim, #aab3c2);
    margin-left: auto;
    margin-right: 6px;
}

.rri-close {
    background: transparent;
    border: 0;
    color: var(--text-dim, #aab3c2);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 140ms ease, background-color 140ms ease;
}

.rri-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.rri-context {
    padding: 0 14px 4px;
    font-size: 10px;
    color: var(--text-muted, #6e7687);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rri-body {
    flex: 1;
    margin: 0 12px;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: var(--text, #e6e9ef);
    font-family: var(--ui, system-ui, sans-serif);
    font-size: 13px;
    line-height: 1.45;
    resize: none;
    outline: none;
}

.rri-body::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.rri-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 10px;
    gap: 8px;
}

.rri-hint {
    font-size: 10px;
    color: var(--text-muted, #6e7687);
    letter-spacing: 0.04em;
}

.rri-hint kbd {
    display: inline-block;
    font-family: var(--mono, monospace);
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 10px;
    color: var(--text-dim, #aab3c2);
    margin: 0 1px;
}

.rri-save {
    background: var(--accent, #56c2ff);
    color: #07101c;
    border: 0;
    padding: 5px 14px;
    border-radius: 4px;
    font-family: var(--display, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 140ms ease, transform 140ms ease;
}

.rri-save:hover { filter: brightness(1.15); }
.rri-save:active { transform: translateY(1px); }

/* Canvas dim while overlay is open — subtle. */
.canvas-dim-during-radial > canvas {
    opacity: 0.55;
    filter: saturate(0.85);
    transition: opacity 140ms ease;
}

/* Ripple at click coord on save — celebratory pulse, color-tinted by category. */
.replay-radial-ripple {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(86, 194, 255, 0.55) 0%,
        rgba(86, 194, 255, 0.25) 45%,
        rgba(86, 194, 255, 0) 100%);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    z-index: 19;
    animation: rri-ripple 420ms cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

.replay-radial-ripple.cat-highlight { background: radial-gradient(circle, rgba(74, 222, 128, 0.6), rgba(74, 222, 128, 0) 70%); }
.replay-radial-ripple.cat-macro     { background: radial-gradient(circle, rgba(86, 194, 255, 0.6), rgba(86, 194, 255, 0) 70%); }
.replay-radial-ripple.cat-scouting  { background: radial-gradient(circle, rgba(125, 211, 252, 0.6), rgba(125, 211, 252, 0) 70%); }
.replay-radial-ripple.cat-mistake   { background: radial-gradient(circle, rgba(248, 113, 113, 0.6), rgba(248, 113, 113, 0) 70%); }
.replay-radial-ripple.cat-opponent  { background: radial-gradient(circle, rgba(251, 191, 36, 0.6), rgba(251, 191, 36, 0) 70%); }
.replay-radial-ripple.cat-micro     { background: radial-gradient(circle, rgba(167, 139, 250, 0.6), rgba(167, 139, 250, 0) 70%); }

@keyframes rri-ripple {
    0%   { transform: translate(-50%, -50%) scale(0);   opacity: 1; }
    60%  { transform: translate(-50%, -50%) scale(2.4); opacity: 0.55; }
    100% { transform: translate(-50%, -50%) scale(3.6); opacity: 0; }
}

/* ============================================================================
   Post-match summary — "Your notes" section. Renders the rollup-note entries
   for this game as clickable cards, ordered by replay timestamp.
   ============================================================================ */

.pm-notes-block {
    margin: 14px 0 18px;
    padding: 14px 16px;
    background: rgba(86, 194, 255, 0.04);
    border: 1px solid rgba(86, 194, 255, 0.15);
    border-radius: 8px;
}

.pm-notes-empty {
    font-size: 12px;
    color: var(--text-muted, #6e7687);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pm-notes-hint {
    font-size: 11px;
    opacity: 0.8;
    font-style: italic;
}

.pm-notes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.pm-notes-eyebrow {
    font-family: var(--display, sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent, #56c2ff);
}

.pm-notes-count {
    font-family: var(--mono, monospace);
    font-size: 11px;
    color: var(--text-muted, #6e7687);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 999px;
}

.pm-notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.pm-note-card {
    --pm-note-color: #56c2ff;
    background: rgba(20, 24, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--pm-note-color);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background-color 140ms ease, transform 140ms ease, border-color 140ms ease;
    outline: none;
}

.pm-note-card:hover,
.pm-note-card:focus-visible {
    background: rgba(20, 24, 32, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.pm-note-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.pm-note-cat {
    font-family: var(--display, sans-serif);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pm-note-color);
}

.pm-note-time {
    font-family: var(--mono, monospace);
    font-size: 11px;
    color: var(--text-dim, #aab3c2);
}

.pm-note-ctx {
    font-size: 10px;
    color: var(--text-muted, #6e7687);
    font-style: italic;
    margin-bottom: 4px;
}

.pm-note-body {
    font-size: 12px;
    color: var(--text, #e6e9ef);
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    /* Clamp very long bodies to keep cards uniform — full text in note tab */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
