@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Crimson+Pro:ital,wght@0,400;0,600;1,400;1,600&display=swap');

:root {
    --ink: #2c1c0e;
    --ink-soft: #4a3419;
    --gold: #b8862f;
    --gold-bright: #d9a940;
    --torch: #ff8a3d;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 18.5px;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Crimson Pro', 'Georgia', serif;
    color: var(--ink);
    min-height: 100vh;
    background-color: #150f0a;
    background-image:
        radial-gradient(ellipse at 50% -10%, #3a2c1a 0%, transparent 55%),
        radial-gradient(ellipse at 50% 110%, #1e150c 0%, transparent 60%),
        repeating-linear-gradient(45deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 3px);
    background-attachment: fixed;
}

.app-shell {
    min-height: 100vh;
}

/* ---------- Header ---------- */

.board-header {
    text-align: center;
    padding: 3rem 1rem 1.5rem;
}

.board-header h1 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: 0.06em;
    color: var(--gold-bright);
    text-shadow: 0 2px 0 #000, 0 0 24px rgba(255, 160, 60, 0.25);
    margin: 0 0 0.4rem;
}

.board-header p {
    color: #c9b896;
    font-style: italic;
    margin: 0;
    letter-spacing: 0.02em;
}

.not-found {
    text-align: center;
    color: #c9b896;
    padding: 3rem;
}

/* ---------- The board: 3 columns, masonry-packed, infinitely tall ---------- */

.board {
    column-count: 3;
    column-gap: 1.75rem;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0.5rem 2rem 5rem;
}

@media (max-width: 1100px) {
    .board { column-count: 2; }
}

@media (max-width: 680px) {
    .board { column-count: 1; padding: 0.5rem 1rem 4rem; }
}

/* ---------- Parchment card shell (shared; variant-specific look lives in parchment.css) ---------- */

.parchment-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin: 0 0 1.9rem;
    position: relative;
}

.parchment-content {
    padding: 2.1rem 1.6rem 1.9rem;
    position: relative;
    z-index: 1;
}

/* ---------- The random-table widget itself ---------- */

.table-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 2px solid rgba(44, 28, 14, 0.25);
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
}

.table-card-header h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    margin: 0;
    letter-spacing: 0.02em;
}

.dice-badge {
    flex: none;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff5e0;
    background: linear-gradient(160deg, #8a1f1f, #5c1414);
    border: 1px solid rgba(0,0,0,0.4);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 2px rgba(0,0,0,0.4);
    white-space: nowrap;
}

.table-subtitle {
    margin: -0.2rem 0 0.8rem;
    font-size: 1.02rem;
    color: var(--ink);
}

.region-picker {
    display: block;
    width: 100%;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.6rem;
    margin: -0.2rem 0 0.8rem;
    border: 1px solid rgba(44, 28, 14, 0.35);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    color: var(--ink);
    cursor: pointer;
}

.region-picker:focus {
    outline: 2px solid rgba(122, 31, 31, 0.4);
    outline-offset: 1px;
}

.table-card-result {
    min-height: 3.4rem;
    display: flex;
    align-items: center;
    margin: 0.6rem 0;
}

.roll-placeholder {
    color: var(--ink-soft);
}

.roll-result {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    animation: roll-in 0.25s ease-out;
}

.roll-number {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #7a1f1f;
    flex: none;
    min-width: 1.6rem;
    text-align: center;
}

.roll-text {
    font-size: 1.1rem;
    line-height: 1.4;
}

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

.table-card-controls {
    display: flex;
    gap: 0.6rem;
    margin: 0.8rem 0 0.3rem;
}

.btn-roll, .btn-toggle {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-roll {
    color: #fff5e0;
    background: linear-gradient(160deg, #8a1f1f, #5c1414);
    border: 1px solid rgba(0,0,0,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 3px rgba(0,0,0,0.35);
}

.btn-toggle {
    color: var(--ink);
    background: rgba(44, 28, 14, 0.08);
    border: 1px solid rgba(44, 28, 14, 0.3);
}

.btn-roll:hover, .btn-toggle:hover {
    transform: translateY(-1px);
}

.btn-roll:active, .btn-toggle:active {
    transform: translateY(0);
}

.roll-history {
    list-style: none;
    margin: 0.7rem 0 0;
    padding: 0.5rem 0 0;
    border-top: 1px dashed rgba(44, 28, 14, 0.3);
    font-size: 0.95rem;
    color: var(--ink);
}

.roll-history li {
    padding: 0.12rem 0;
}

.history-roll {
    font-weight: 700;
    margin-right: 0.4rem;
}

.menu-section {
    margin-top: 1rem;
}

.menu-section h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin: 0 0 0.4rem;
    color: #7a1f1f;
    border-bottom: 1px solid rgba(44, 28, 14, 0.2);
    padding-bottom: 0.2rem;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.02rem;
    line-height: 1.6;
}

.menu-list li {
    padding: 0.15rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.menu-item-name {
    font-weight: 700;
}

.menu-item-desc {
    color: var(--ink);
    flex: 1 1 auto;
}

.menu-item-price {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #7a1f1f;
    white-space: nowrap;
}

.menu-total {
    margin-top: 1rem;
    padding-top: 0.6rem;
    border-top: 2px solid rgba(44, 28, 14, 0.25);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    text-align: right;
}

.name-columns {
    display: flex;
    gap: 1.2rem;
    margin-top: 1rem;
}

.name-column {
    flex: 1 1 50%;
    min-width: 0;
}

.name-column h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    margin: 0 0 0.4rem;
    color: #7a1f1f;
    border-bottom: 1px solid rgba(44, 28, 14, 0.2);
    padding-bottom: 0.2rem;
}

.name-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.02rem;
    line-height: 1.65;
}

.name-list li {
    padding: 0.1rem 0;
}

.name-race-tag {
    display: inline-block;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #fff5e0;
    background: linear-gradient(160deg, #8a1f1f, #5c1414);
    border-radius: 3px;
    padding: 0.05rem 0.4rem;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.name-value {
    vertical-align: middle;
}

@media (max-width: 420px) {
    .name-columns {
        flex-direction: column;
        gap: 0.6rem;
    }
}

.full-table-panel {
    margin-top: 0.9rem;
}

.table-search {
    width: 100%;
    font-family: 'Crimson Pro', 'Georgia', serif;
    font-size: 1rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(44, 28, 14, 0.35);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    color: var(--ink);
    margin-bottom: 0.6rem;
}

.table-search:focus {
    outline: 2px solid rgba(122, 31, 31, 0.4);
    outline-offset: 1px;
}

.table-truncated-note {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin: 0.5rem 0 0;
}

.full-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.full-table td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid rgba(44, 28, 14, 0.15);
    vertical-align: top;
}

.full-table .range-cell {
    font-weight: 700;
    color: #7a1f1f;
    white-space: nowrap;
    width: 3.2rem;
}
