:root {
    --red: #e5261f;
    --yellow: #ffd22e;
    --blue: #67b7e8;
    --dark: #111;
    --paper: #fff7e6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle, rgba(255,255,255,.25) 2px, transparent 3px),
        linear-gradient(135deg, #48a6df, #1d6faa);
    background-size: 22px 22px, cover;
    color: var(--dark);
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 22px;
}

.comic-box {
    border: 5px solid #111;
    box-shadow: 8px 8px 0 #111;
    background: var(--paper);
}

.hero {
    overflow: hidden;
}

.top-strip {
    background: var(--red);
    border-bottom: 5px solid #111;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: clamp(3rem, 9vw, 6.5rem);
    font-weight: 1000;
    letter-spacing: -5px;
    color: var(--yellow);
    -webkit-text-stroke: 4px #111;
    text-shadow: 5px 5px 0 #111;
    line-height: .9;
}

.logo span {
    color: white;
}

.bubble {
    background: white;
    border: 4px solid #111;
    border-radius: 28px;
    padding: 14px 20px;
    font-weight: 1000;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--red);
    transform: rotate(-2deg);
    box-shadow: 5px 5px 0 #111;
    text-align: center;
}

.main-panel {
    padding: 34px;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: center;
    background:
        linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.78)),
        repeating-linear-gradient(45deg, #bfe6ff 0 8px, #a6d8f8 8px 16px);
}

.claim {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    margin: 0 0 18px;
    font-weight: 1000;
}

.claim strong {
    color: var(--red);
}

.subclaim {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 24px;
}

.shortener {
    background: var(--red);
    border: 5px solid #111;
    padding: 16px;
    box-shadow: 6px 6px 0 #111;
}

.shortener-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 1000;
    margin-bottom: 12px;
}

.shortener form {
    display: flex;
    gap: 10px;
}

.shortener input {
    flex: 1;
    padding: 15px;
    border: 4px solid #111;
    font-size: 1.05rem;
    font-weight: 700;
}

.shortener button,
.btn {
    background: var(--yellow);
    border: 4px solid #111;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 1000;
    cursor: pointer;
    box-shadow: 4px 4px 0 #111;
    color: #111;
    text-decoration: none;
    display: inline-block;
}

.shortener button:hover,
.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #111;
}

.small-btn {
    padding: 6px 9px;
    border-width: 3px;
    box-shadow: 3px 3px 0 #111;
    font-size: .78rem;
}

.mascot {
    min-height: 310px;
    border: 5px solid #111;
    background:
        radial-gradient(circle at 50% 35%, white 0 9%, transparent 10%),
        linear-gradient(160deg, #111 0 45%, #222 45% 100%);
    position: relative;
    border-radius: 20px;
    box-shadow: 6px 6px 0 #111;
}

.mascot::before {
    content: "QR";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -25%);
    background: white;
    border: 4px solid #111;
    padding: 24px;
    font-size: 4rem;
    font-weight: 1000;
}

.mascot::after {
    content: "¡ESCANEA Y LISTO!";
    position: absolute;
    right: -12px;
    top: 24px;
    background: white;
    border: 4px solid #111;
    border-radius: 22px;
    padding: 12px;
    font-weight: 1000;
    color: var(--red);
    transform: rotate(5deg);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin: 34px 0;
}

.card {
    background: white;
    border: 5px solid #111;
    box-shadow: 6px 6px 0 #111;
    padding: 18px;
    min-height: 170px;
}

.card h2 {
    display: inline-block;
    background: var(--yellow);
    border: 4px solid #111;
    padding: 8px 12px;
    margin: -35px 0 16px;
    font-size: 1.3rem;
    transform: rotate(-1deg);
}

.card p {
    font-weight: 750;
    font-size: 1.05rem;
}

.info {
    padding: 28px;
    margin-bottom: 34px;
}

.info h2 {
    font-size: 2rem;
    margin-top: 0;
}

.error,
.notice {
    margin-top: 16px;
    background: #fff;
    border: 4px solid #111;
    color: var(--red);
    padding: 12px;
    font-weight: 1000;
}

.notice {
    color: #111;
    background: #d8ffd8;
}

.footer {
    text-align: center;
    color: white;
    font-weight: 900;
    padding: 18px;
}

.admin-wrap {
    max-width: 1250px;
    margin: 0 auto;
    padding: 22px;
}

.admin-panel {
    background: white;
    border: 5px solid #111;
    box-shadow: 8px 8px 0 #111;
    padding: 22px;
    margin-bottom: 24px;
}

.admin-panel h1,
.admin-panel h2 {
    margin-top: 0;
}

.admin-form {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.admin-form-qr {
    grid-template-columns: 1fr 2fr 1fr 1.2fr auto;
}

.admin-form label {
    font-weight: 900;
}

.admin-form input,
.login-form input,
.table-input {
    width: 100%;
    padding: 10px;
    border: 3px solid #111;
    font-size: 1rem;
    margin-bottom: 6px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th,
.table td {
    border: 3px solid #111;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.table th {
    background: var(--yellow);
}

.small {
    font-size: .85rem;
    font-weight: 700;
}

.actions,
.qr-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.login-box {
    max-width: 480px;
    margin: 12vh auto;
    background: white;
    border: 5px solid #111;
    box-shadow: 8px 8px 0 #111;
    padding: 24px;
}

.login-form {
    display: grid;
    gap: 12px;
}

.qr-cell {
    width: 150px;
    text-align: center;
}

.qr-preview {
    width: 120px;
    height: 120px;
    border: 3px solid #111;
    background: white;
    display: block;
    margin: 0 auto;
}

.inline-check {
    display: flex;
    gap: 6px;
    align-items: center;
    margin: 6px 0;
}

.inline-check input {
    width: auto;
}

@media (max-width: 950px) {
    .table,
    .table thead,
    .table tbody,
    .table th,
    .table td,
    .table tr {
        display: block;
    }

    .table thead {
        display: none;
    }

    .table tr {
        border: 4px solid #111;
        margin-bottom: 18px;
        padding: 10px;
    }

    .table td {
        border: 0;
        border-bottom: 2px solid #ddd;
    }

    .qr-cell {
        width: auto;
    }
}

@media (max-width: 800px) {
    .top-strip,
    .main-panel,
    .cards,
    .admin-form,
    .admin-form-qr {
        grid-template-columns: 1fr;
        display: grid;
    }

    .shortener form {
        flex-direction: column;
    }

    .mascot {
        min-height: 220px;
    }
}
