.a4-body {
    background: #0f1629;
}

.a4-wrap {
    max-width: 230mm;
    margin: 0 auto;
    padding: 1rem;
}

.a4-toolbar {
    margin: 0 auto 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid #d4a44c;
    border-radius: 8px;
    background: #fffdf8;
    color: #18223b;
}

.a4-sheet {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 10mm;
    overflow: hidden;
    background: #fffef9;
    color: #151515;
    border: 1.5px solid #111;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.a4-sheet::before {
    content: "";
    position: absolute;
    inset: 6mm;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 14px 10px 13px 9px;
}

.sketch {
    position: absolute;
    width: 34mm;
    height: auto;
    fill: none;
    stroke: rgba(0, 0, 0, 0.34);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sketch-dice {
    right: 12mm;
    top: 12mm;
    transform: rotate(4deg);
}

.sketch-quill {
    left: 11mm;
    bottom: 12mm;
    transform: rotate(-7deg);
}

.a4-title,
.a4-main-grid,
.a4-rules,
.notes-panel {
    position: relative;
    z-index: 1;
}

.a4-title {
    display: grid;
    grid-template-columns: 0.8fr 1.7fr;
    gap: 7mm;
    align-items: end;
    margin-bottom: 5mm;
    padding-bottom: 4mm;
    border-bottom: 2px solid #111;
}

.a4-title p {
    margin: 0 0 1mm;
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.a4-title h2,
.a4-panel h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0;
}

.a4-title h2 {
    font-size: 25pt;
    line-height: 1;
}

.a4-id-grid,
.a4-main-grid {
    display: grid;
    gap: 3mm;
}

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

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

.a4-panel {
    border: 1px solid #111;
    border-radius: 7px 5px 8px 6px;
    padding: 3mm;
    background: rgba(255, 255, 255, 0.72);
}

.a4-panel h3 {
    padding-bottom: 1.5mm;
    margin-bottom: 2.5mm;
    border-bottom: 1px solid #111;
    font-size: 12pt;
    text-transform: uppercase;
}

.a4-panel label,
.a4-id-grid label {
    display: flex;
    flex-direction: column;
    gap: 1mm;
    font-size: 8.5pt;
    font-weight: 700;
}

.a4-panel input[type="text"],
.a4-panel input[type="number"],
.a4-panel textarea,
.a4-id-grid input {
    width: 100%;
    min-height: 8mm;
    border: 1px solid #555;
    border-radius: 4px;
    background: #fff;
    color: #111;
    padding: 1.2mm 1.5mm;
    font: inherit;
}

.a4-panel textarea {
    resize: vertical;
}

.a4-trait {
    display: grid;
    grid-template-columns: 22mm 1fr;
    gap: 3mm;
    align-items: center;
    margin-bottom: 2.5mm;
}

.a4-trait input[type="number"],
.a4-defense input[type="number"] {
    min-height: 11mm;
    text-align: center;
    font-size: 16pt;
    font-weight: 700;
}

.a4-damage {
    display: grid;
    grid-template-columns: 12mm repeat(4, 1fr);
    gap: 1.5mm;
    align-items: center;
}

.a4-damage span {
    font-size: 7.8pt;
    font-weight: 700;
}

.a4-damage label,
.a4-jokers label {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 7mm;
    border: 1px dashed #777;
    border-radius: 4px;
    font-weight: 700;
}

.a4-defense {
    display: grid;
    grid-template-columns: 22mm 1fr;
    gap: 3mm;
    align-items: center;
    padding-top: 2mm;
    border-top: 1px dashed #777;
}

.a4-defense p {
    margin: 0;
    font-size: 8pt;
}

.a4-jokers {
    display: grid;
    grid-template-columns: 1fr repeat(3, 18mm);
    gap: 2mm;
    align-items: center;
    margin-bottom: 3mm;
}

.a4-rules {
    margin-top: 3mm;
}

.a4-rules-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4mm;
}

.a4-rules table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.8pt;
}

.a4-rules th,
.a4-rules td {
    border: 1px solid #333;
    padding: 1.2mm;
    vertical-align: top;
}

.a4-rules td:first-child {
    width: 22mm;
    font-weight: 700;
}

.a4-rules ul {
    margin: 0;
    padding-left: 4mm;
    font-size: 8pt;
}

.notes-panel {
    margin-top: 3mm;
}

.notes-lines {
    min-height: 28mm;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 7mm, rgba(0, 0, 0, 0.35) 7.2mm);
}

@media (max-width: 900px) {
    .a4-sheet {
        width: 100%;
        min-height: auto;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    .a4-site-header,
    .a4-toolbar {
        display: none;
    }

    .a4-body {
        background: #fff;
    }

    .a4-wrap {
        max-width: none;
        padding: 0;
    }

    .a4-sheet {
        width: 210mm;
        min-height: 297mm;
        box-shadow: none;
        border: 0;
    }
}
