/* XP calculator - builds on text-generators.css (.tg-* layout, panels, commands). */
.xp-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.xp-presets {
    justify-content: center;
    margin: 4px 0 14px;
}

.xp-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 10px;
    align-items: center;
}

.xp-progress input[type="range"] {
    accent-color: #80ff20;
}

.xp-inline-result {
    margin: 8px 0 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.xp-facts {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main .xp-facts li {
    padding: 8px 12px;
    border: 1px solid var(--tg-line);
    border-radius: 10px;
    background: var(--tg-field);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: left;
}

.xp-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 14px;
}

.xp-result-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.xp-result-number {
    color: #80ff20;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.xp-stage {
    min-height: 0;
    padding: 22px 14px;
}

.xp-stage canvas {
    width: 100%;
    max-width: 570px;
    height: auto;
    image-rendering: pixelated;
}

.xp-death i {
    color: var(--danger, #ff6b6b);
}

.xp-sources {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.xp-sources li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--tg-line);
    border-radius: 12px;
    background: var(--tg-field);
}

.xp-sources img {
    flex: 0 0 auto;
    image-rendering: pixelated;
}

.xp-source-name {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}

.xp-source-name strong {
    font-size: 0.86rem;
}

.xp-source-name small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.xp-source-count {
    color: #80ff20;
    font-weight: 700;
    white-space: nowrap;
}

.xp-commands-settings {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
}

.xp-cmds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.main .tg-below .tg-panel + .tg-panel {
    margin-top: 24px;
}

.xp-table-wrap {
    overflow-x: auto;
}

.xp-table {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.xp-table th,
.xp-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--tg-line);
}

.xp-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.xp-table tr.is-target td {
    background: var(--tg-accent-soft);
    color: var(--text-primary);
    font-weight: 700;
}

@media (max-width: 900px) {
    .xp-cmds {
        grid-template-columns: 1fr;
    }
}
