/* Variables */
:root {
    --bg: #f9fafb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
}

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body */
body {
    font-family: "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--muted);
    font-size: 1rem;
}

/* Grid of cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* Card */
.card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Card top row */
.card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
}

.id {
    font-size: 1rem;
}

.rank {
    color: var(--accent);
}

/* Hash */
.hash {
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 0.85rem;
    color: var(--muted);
    word-break: break-all;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    transition: background 0.2s;
}

.page-btn:hover {
    background: var(--accent-hover);
}

.page-number {
    font-weight: 600;
    color: var(--muted);
}
/* =========================
   Solution Page
   ========================= */

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.solution-header {
    margin-bottom: 32px;
}

.solution-header h1 {
    margin-bottom: 20px;
}

/* Stats */

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.stat {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    min-width: 140px;
}

.stat .label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.stat .value {
    font-weight: 700;
    font-size: 1.05rem;
}

.hash-stat {
    flex: 1;
    min-width: 300px;
}

.hash {
    font-family: monospace;
    word-break: break-all;
}

/* Panels */

.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.panel h2 {
    margin-bottom: 20px;
}

.section-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: normal;
}

/* Plane Grid */

.plane-grid {
    display: inline-grid;
    gap: 3px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 12px;
}

.plane-cell {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    font-size: 0.8rem;
    font-weight: 600;

    color: rgba(0, 0, 0, 0.75);
}

/* Tiles */

.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.tile-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: #fafafa;
}

.tile-title {
    text-align: center;
    font-weight: 600;
    margin-bottom: 12px;
}

.edge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-items: center;
    gap: 4px;
}

.edge {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
}

.edge-top {
    grid-column: 2;
    grid-row: 1;
}

.edge-left {
    grid-column: 1;
    grid-row: 2;
}

.edge-center {
    grid-column: 2;
    grid-row: 2;
    color: var(--accent);
}

.edge-right {
    grid-column: 3;
    grid-row: 2;
}

.edge-bottom {
    grid-column: 2;
    grid-row: 3;
}


.render-container {
    height: 90vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.render-image {
    width: 100%;
    object-fit: cover;      /* crop instead of distortion */
    display: block;
    border-radius: 6px;
}
.render-small {
    width: 100%;
    aspect-ratio: 1 / 1; /* or your tileset ratio */
    display: block;
    margin: 0.5em 0;
    object-fit: contain;
}
