:root {
    --bg-warm: #fdfaf6;
    --card-bg: #ffffff;
    --text-main: #4a4a4a;
    --text-muted: #8c8c8c;
    --accent: #d4a373;
    --accent-light: #faedcd;
    --border: #f1ebd9;

    /* Fortune Colors (Subtle/Soft) */
    --c-god: #e9c46a;
    --c-excellent: #2a9d8f;
    --c-good: #8ab17d;
    --c-average: #e76f51;
    --c-small-luck: #a8dadc;
    --c-bad: #e07a5f;
    --c-very-bad: #bc4749;
    --c-terrible: #780000;
    --c-end: #1b1b1b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-warm);
    color: var(--text-main);
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

header {
    margin-bottom: 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 2px;
}

#subtitle {
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-top: 0.5rem;
    font-weight: 700;
}

.fortune-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.fortune-ratio {
    margin-bottom: 2rem;
}

.value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.ratio-bar-container {
    width: 100%;
    height: 6px;
    background: var(--accent-light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
}

.ratio-bar {
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.fortune-comment {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    background: #fffcf0;
    text-align: left;
}

#comment-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-main);
}

.fortune-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: left;
}

.stat-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: monospace;
}

nav {
    margin-top: 2rem;
}

.nav-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    border-bottom: 1px solid var(--accent);
}

footer {
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Fortune Themes */
.grade-god h2,
.h-item-god .h-fortune {
    color: var(--c-god);
}

.grade-excellent h2,
.h-item-excellent .h-fortune {
    color: var(--c-excellent);
}

.grade-good h2,
.h-item-good .h-fortune {
    color: var(--c-good);
}

.grade-average h2,
.h-item-average .h-fortune {
    color: var(--c-average);
}

.grade-small-luck h2,
.h-item-small-luck .h-fortune {
    color: var(--c-small-luck);
}

.grade-bad h2,
.h-item-bad .h-fortune {
    color: var(--c-bad);
}

.grade-very-bad h2,
.h-item-very-bad .h-fortune {
    color: var(--c-very-bad);
}

.grade-terrible h2,
.h-item-terrible .h-fortune {
    color: var(--c-terrible);
}

.grade-end h2,
.h-item-end .h-fortune {
    color: var(--c-end);
}

/* History Page Styles */
.history-list {
    text-align: left;
    margin-top: 2rem;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.h-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.h-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.2rem;
}

.h-fortune {
    font-weight: 700;
    font-size: 1.25rem;
}

.h-ratio-info {
    text-align: right;
}

.h-ratio-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.h-comment {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
    padding: 0.8rem 1rem;
    background: #fffcf8;
    border-radius: 0.5rem;
    border-left: 2px solid var(--accent);
}

.h-bar-container {
    width: 100%;
    height: 4px;
    background: var(--accent-light);
    border-radius: 2px;
    overflow: hidden;
}

.h-bar {
    height: 100%;
    background: var(--accent);
}

.h-item-god .h-bar {
    background: var(--c-god);
}

.h-item-excellent .h-bar {
    background: var(--c-excellent);
}

.h-item-good .h-bar {
    background: var(--c-good);
}

.h-item-average .h-bar {
    background: var(--c-average);
}

.h-item-small-luck .h-bar {
    background: var(--c-small-luck);
}

.h-item-bad .h-bar {
    background: var(--c-bad);
}

.h-item-very-bad .h-bar {
    background: var(--c-very-bad);
}

.h-item-terrible .h-bar {
    background: var(--c-terrible);
}

.h-item-end .h-bar {
    background: var(--c-end);
}