:root {
    --paper: #fffdf8;
    --ink: #2a1a10;
    --accent: #b8541e;
    --muted: #7a6a58;
    --border: #e6d9c1;
}

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

body {
    font-family: 'Courier New', Courier, monospace;
    background: var(--ink);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.ticket {
    background: var(--paper);
    max-width: 380px;
    width: 100%;
    padding: 2rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    position: relative;
}

.ticket::before,
.ticket::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 14px;
    background: radial-gradient(circle, var(--ink) 6px, transparent 7px);
    background-size: 20px 20px;
    background-position: 0 center;
}
.ticket::before { top: -7px; }
.ticket::after { bottom: -7px; }

h1 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.subtitle {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

#result {
    min-height: 80px;
    margin-bottom: 1.5rem;
    text-align: left;
}
#result h2 { font-size: 1.2rem; margin-bottom: 0.2rem; }
#result .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.6rem; }
#result h3 {
    font-size: 0.8rem;
    margin: 0.9rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}
#result hr {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 1rem 0;
}

.placeholder, .loading, .error {
    text-align: center;
    color: var(--muted);
    padding: 1.5rem 0;
}
.error { color: #a83a2e; }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}
.chip {
    background: #f5ead7;
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

.method {
    margin-bottom: 0.7rem;
    font-size: 0.85rem;
    line-height: 1.5;
}
.fortune {
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.6;
}

button {
    width: 100%;
    padding: 0.8rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.05em;
}
button:hover { background: #9c4419; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.back {
    margin-top: 1.2rem;
    font-size: 0.8rem;
}
.back a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.back a:hover { border-color: var(--muted); }

@media (max-width: 480px) {
    .ticket { padding: 1.5rem 1rem; }
}
