:root {
    color-scheme: dark;
    font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
    background: #18351f;
    color: #fff8df;
}

* { box-sizing: border-box; }

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100dvh;
    overflow: hidden;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 24%, rgba(177, 213, 104, 0.22), transparent 44%),
        linear-gradient(145deg, #244e2e, #102619);
}

button {
    appearance: none;
    border: 1px solid rgba(255, 243, 199, 0.24);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    background: rgba(20, 35, 21, 0.78);
    color: #fff7d8;
    font: 600 0.78rem/1 system-ui, sans-serif;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(255, 222, 113, 0.7);
    background: rgba(48, 66, 34, 0.9);
}

button:focus-visible,
canvas:focus-visible {
    outline: 3px solid #ffe17b;
    outline-offset: 3px;
}

button:disabled {
    cursor: default;
    opacity: 0.48;
}

.game-shell {
    position: relative;
    width: min(100vw, calc(100dvh * 4 / 3));
    height: min(100dvh, calc(100vw * 3 / 4));
    min-width: 280px;
    margin: auto;
    isolation: isolate;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: clamp(0px, 1.8vw, 18px);
    box-shadow: 0 22px 70px rgba(3, 15, 6, 0.48);
    touch-action: none;
    user-select: none;
}

.game-toolbar {
    position: absolute;
    z-index: 4;
    top: max(0.65rem, env(safe-area-inset-top));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 0.42rem;
    max-width: calc(100% - 1.25rem);
    transform: translateX(-50%);
}

.game-toolbar .toolbar-hex-button {
    position: relative;
    display: grid;
    flex: 0 0 2.65rem;
    width: 2.65rem;
    height: 2.35rem;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 0;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: #d5a13b;
    color: #fff1a8;
    font-size: 1.15rem;
    line-height: 1;
}

.game-toolbar .toolbar-hex-button::before {
    position: absolute;
    inset: 2px;
    clip-path: inherit;
    background: rgba(27, 42, 22, 0.94);
    content: '';
}

.game-toolbar .toolbar-hex-button span {
    position: relative;
    z-index: 1;
}

.game-toolbar .toolbar-hex-button:hover:not(:disabled) {
    background: #ffe079;
}

.game-toolbar .toolbar-hex-button:focus-visible {
    filter: drop-shadow(0 0 5px #ffe17b);
}

.save-indicator {
    display: grid;
    width: 1rem;
    color: rgba(244, 246, 218, 0.72);
    font-size: 0.68rem;
    place-items: center;
}

.intro-card {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: min(34rem, calc(100% - 2rem));
    padding: clamp(1.25rem, 4vw, 2.2rem);
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 240, 185, 0.24);
    border-radius: 1.4rem;
    background: linear-gradient(145deg, rgba(24, 37, 22, 0.94), rgba(18, 28, 16, 0.88));
    box-shadow: 0 22px 65px rgba(3, 13, 5, 0.5);
    backdrop-filter: blur(18px);
}

.intro-card[hidden] { display: none; }

.collection-panel {
    position: absolute;
    z-index: 6;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    width: min(58rem, calc(100% - 1.5rem));
    height: min(39rem, calc(100% - 1.5rem));
    max-height: 39rem;
    padding: clamp(0.85rem, 2vw, 1.2rem);
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 224, 118, 0.38);
    border-radius: 1.15rem;
    background:
        linear-gradient(145deg, rgba(45, 35, 18, 0.97), rgba(18, 31, 20, 0.98)),
        repeating-linear-gradient(0deg, transparent 0 25px, rgba(255, 240, 184, 0.045) 26px);
    box-shadow: 0 24px 70px rgba(3, 13, 5, 0.68);
    backdrop-filter: blur(18px);
}

.collection-panel[hidden] { display: none; }

.upgrade-backdrop,
.queen-backdrop,
.lost-bee-backdrop {
    position: absolute;
    z-index: 7;
    inset: 0;
    border-radius: inherit;
    background: rgba(18, 12, 7, 0.58);
    backdrop-filter: blur(3px);
}

.upgrade-backdrop[hidden],
.upgrade-panel[hidden],
.upgrade-panel [hidden],
.queen-backdrop[hidden],
.queen-panel[hidden],
.queen-panel [hidden],
.lost-bee-backdrop[hidden],
.lost-bee-panel[hidden] {
    display: none;
}

.upgrade-panel {
    position: absolute;
    z-index: 8;
    top: 50%;
    left: 50%;
    width: min(25rem, calc(100% - 1.5rem));
    padding: clamp(1rem, 3vw, 1.35rem);
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 218, 102, 0.48);
    border-radius: 1.15rem;
    background:
        radial-gradient(circle at 18% 0, rgba(226, 157, 46, 0.18), transparent 38%),
        linear-gradient(145deg, rgba(58, 39, 19, 0.98), rgba(20, 30, 18, 0.98));
    box-shadow: 0 24px 70px rgba(3, 13, 5, 0.72);
}

.upgrade-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.upgrade-header .eyebrow {
    margin: 0 0 0.2rem;
    color: #d8b66d;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.upgrade-header h2 {
    margin: 0;
    color: #ffe589;
    font: 700 clamp(1.25rem, 5vw, 1.7rem)/1.05 Georgia, serif;
}

.upgrade-icon {
    display: grid;
    flex: 0 0 3.3rem;
    width: 3.3rem;
    height: 3rem;
    place-items: center;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: linear-gradient(145deg, #d4932d, #82501d);
    color: #fff0a4;
    font-size: 1.45rem;
    filter: drop-shadow(0 5px 10px rgba(14, 8, 3, 0.36));
}

.upgrade-transition,
.upgrade-message {
    color: #d7d9b8;
    font-size: 0.76rem;
}

.upgrade-transition {
    margin: 0.28rem 0 0;
    font-weight: 800;
}

.upgrade-message {
    min-height: 1.15rem;
    margin: 0.9rem 0 0.65rem;
    line-height: 1.45;
}

.upgrade-requirements {
    display: grid;
    gap: 0.42rem;
}

.upgrade-requirement {
    display: grid;
    grid-template-columns: 1.7rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid rgba(255, 231, 158, 0.12);
    border-radius: 0.68rem;
    background: rgba(255, 249, 218, 0.035);
    color: #d8cfaa;
    font-size: 0.72rem;
}

.upgrade-requirement.is-ready {
    border-color: rgba(224, 185, 72, 0.3);
    color: #fff0b1;
}

.upgrade-requirement-icon {
    color: #e7b94b;
    font-size: 1rem;
    text-align: center;
}

.upgrade-requirement strong {
    color: inherit;
    font-size: 0.76rem;
}

.upgrade-progress-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    margin: 0.75rem 0;
}

.upgrade-progress {
    height: 0.55rem;
    overflow: hidden;
    border: 1px solid rgba(255, 225, 123, 0.22);
    border-radius: 999px;
    background: rgba(8, 12, 7, 0.74);
}

.upgrade-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #a66a25, #e3b540, #ffe27c);
    transition: width 180ms linear;
}

.upgrade-progress-block strong {
    min-width: 3.2rem;
    color: #ffe69a;
    font-size: 0.72rem;
    text-align: right;
}

.upgrade-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 1rem;
}

.upgrade-actions .primary-button {
    margin: 0;
}

.queen-backdrop {
    z-index: 9;
}

.queen-panel {
    position: absolute;
    z-index: 10;
    top: 50%;
    left: 50%;
    width: min(27rem, calc(100% - 1.2rem));
    max-height: calc(100% - 1.2rem);
    padding: clamp(0.9rem, 3vw, 1.25rem);
    overflow-y: auto;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255, 220, 112, 0.48);
    border-radius: 1.2rem;
    background:
        radial-gradient(circle at 18% 4%, rgba(246, 187, 66, 0.2), transparent 34%),
        linear-gradient(145deg, rgba(70, 43, 20, 0.99), rgba(18, 29, 18, 0.99));
    box-shadow: 0 24px 72px rgba(3, 10, 4, 0.78);
}

.queen-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.queen-portrait {
    display: grid;
    flex: 0 0 4rem;
    width: 4rem;
    height: 3.5rem;
    place-items: center;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: radial-gradient(circle at 50% 34%, #f7cd58, #9b5d20 70%);
    color: #fff4b2;
    font-size: 1.65rem;
    filter: drop-shadow(0 6px 10px rgba(17, 8, 2, 0.4));
}

.queen-identity {
    min-width: 0;
    flex: 1;
}

.queen-identity .eyebrow {
    margin: 0 0 0.17rem;
    color: #d8b66d;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.queen-name-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.2rem;
    gap: 0.35rem;
}

.queen-name-form input {
    min-width: 0;
    padding: 0.3rem 0.45rem;
    border: 0;
    border-bottom: 1px solid rgba(255, 224, 126, 0.36);
    border-radius: 0.35rem 0.35rem 0 0;
    outline: 0;
    background: rgba(255, 250, 218, 0.05);
    color: #ffe895;
    font: 700 clamp(1.18rem, 5vw, 1.55rem)/1.05 Georgia, serif;
}

.queen-name-form input:focus {
    border-color: #ffe27d;
    box-shadow: 0 2px rgba(255, 226, 125, 0.18);
}

.queen-name-form button {
    min-height: 2rem;
    padding: 0;
    border-color: rgba(255, 226, 125, 0.28);
    border-radius: 0.55rem;
    background: rgba(184, 123, 34, 0.28);
    color: #ffe895;
}

.queen-level {
    margin: 0.25rem 0 0;
    color: #d7c796;
    font-size: 0.67rem;
    font-weight: 800;
}

.queen-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.38rem;
    margin-top: 0.9rem;
}

.queen-stat {
    display: grid;
    justify-items: center;
    gap: 0.12rem;
    min-width: 0;
    padding: 0.5rem 0.2rem;
    border: 1px solid rgba(255, 231, 158, 0.12);
    border-radius: 0.65rem;
    background: rgba(255, 249, 218, 0.035);
    text-align: center;
}

.queen-stat > span {
    color: #e1ad3c;
    font-size: 0.9rem;
}

.queen-stat strong {
    max-width: 100%;
    overflow: hidden;
    color: #fff0ad;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queen-stat small {
    color: #a99b78;
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.queen-vitality {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.38rem;
    margin-top: 0.36rem;
}

.queen-vitality > span,
.queen-care-progress > span {
    display: block;
    height: 0.28rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(7, 13, 8, 0.72);
}

.queen-vitality i,
.queen-care-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9b6327, #efbb45, #ffe486);
    transition: width 180ms linear;
}

.queen-vitality span:last-child i {
    background: linear-gradient(90deg, #756533, #c7c864, #eceda1);
}

.queen-court-row {
    display: grid;
    grid-template-columns: 5.2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.8rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid rgba(255, 225, 129, 0.15);
    border-radius: 0.72rem;
    background: rgba(97, 64, 22, 0.22);
}

.queen-court-icon {
    color: #e1b13f;
    font-size: 0.63rem;
    letter-spacing: 0.08em;
    text-align: center;
}

.queen-court-row strong {
    display: block;
    color: #f4dda0;
    font-size: 0.72rem;
}

.queen-court-row small {
    display: block;
    margin-top: 0.13rem;
    color: #b8ad8d;
    font-size: 0.58rem;
}

.queen-care-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.queen-care-progress strong {
    color: #ffe598;
    font-size: 0.65rem;
}

.queen-biological-note {
    margin: 0.72rem 0 0;
    color: #bdb494;
    font-size: 0.6rem;
    line-height: 1.4;
}

.queen-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.queen-actions .primary-button {
    margin: 0;
}

.lost-bee-backdrop {
    z-index: 11;
    background: rgba(12, 10, 7, 0.72);
}

.lost-bee-panel {
    position: absolute;
    z-index: 12;
    top: 50%;
    left: 50%;
    width: min(25rem, calc(100% - 1.2rem));
    padding: clamp(1.2rem, 4vw, 1.7rem);
    transform: translate(-50%, -50%);
    border: 1px solid rgba(244, 196, 79, 0.48);
    border-radius: 1.15rem;
    background:
        radial-gradient(circle at 50% 0, rgba(230, 165, 46, 0.2), transparent 42%),
        linear-gradient(150deg, rgba(52, 35, 18, 0.99), rgba(18, 27, 17, 0.99));
    box-shadow: 0 24px 72px rgba(3, 10, 4, 0.8);
    text-align: center;
}

.lost-bee-symbol {
    display: grid;
    width: 3.8rem;
    height: 3.3rem;
    margin: 0 auto 0.8rem;
    place-items: center;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: linear-gradient(145deg, #edb33f, #85511d);
    color: #2b1d0d;
    font-size: 1.15rem;
    box-shadow: 0 8px 24px rgba(2, 9, 3, 0.38);
}

.lost-bee-panel .eyebrow {
    margin: 0 0 0.25rem;
    color: #d8b66d;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lost-bee-panel h2 {
    margin: 0;
    color: #ffe589;
    font: 700 clamp(1.45rem, 6vw, 2rem)/1.05 Georgia, serif;
}

.lost-bee-panel > p:not(.eyebrow) {
    margin: 0.75rem auto 0;
    max-width: 21rem;
    color: #e3dec9;
    font-size: 0.82rem;
    line-height: 1.5;
}

.lost-bee-actions {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.1rem;
}

.lost-bee-actions .primary-button {
    margin: 0;
}

.collection-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
}

.collection-header .eyebrow {
    margin: 0 0 0.25rem;
    color: #b7d48a;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.collection-header h2 {
    margin: 0;
    color: #ffe27d;
    font: 700 clamp(1.35rem, 4vw, 2rem)/1 Georgia, serif;
}

.collection-summary {
    margin: 0.4rem 0 0;
    color: #d4ddbf;
    font-size: 0.78rem;
}

.collection-progress-block {
    flex: 0 0 auto;
    margin-top: 0.7rem;
}

.collection-progress {
    display: block;
    height: 0.42rem;
    overflow: hidden;
    border: 1px solid rgba(255, 226, 126, 0.2);
    border-radius: 999px;
    background: rgba(5, 15, 8, 0.72);
}

.collection-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #79aa51, #e2b747, #ffe084);
    box-shadow: 0 0 10px rgba(255, 217, 99, 0.42);
    transition: width 360ms ease;
}

.collection-rarity-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.collection-rarity-item {
    --flower-color: #7fbd4a;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.32rem 0.45rem;
    border: 1px solid color-mix(in srgb, var(--flower-color) 28%, transparent);
    border-radius: 0.48rem;
    background: rgba(255, 250, 220, 0.035);
}

.collection-rarity-item i {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--flower-color);
    box-shadow: 0 0 6px color-mix(in srgb, var(--flower-color) 70%, transparent);
}

.collection-rarity-item strong {
    overflow: hidden;
    color: #e9e5cf;
    font-size: 0.6rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-rarity-item small {
    color: var(--flower-color);
    font-size: 0.61rem;
    font-weight: 800;
}

.collection-filters {
    display: flex;
    flex: 0 0 auto;
    gap: 0.35rem;
    margin: 0.6rem 0;
    padding-bottom: 0.1rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.collection-filters button {
    flex: 0 0 auto;
    padding: 0.42rem 0.62rem;
    border-color: rgba(255, 240, 184, 0.14);
    font-size: 0.63rem;
}

.collection-filters button[aria-pressed="true"] {
    border-color: rgba(255, 221, 103, 0.78);
    background: #b37a27;
    color: #fff5c4;
}

.collection-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 0.8fr);
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
}

.collection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr));
    align-content: start;
    gap: 0.5rem;
    min-width: 0;
    min-height: 0;
    padding: 0.1rem 0.25rem 0.2rem 0.05rem;
    overflow-y: auto;
    scrollbar-color: rgba(225, 179, 72, 0.5) transparent;
}

.collection-flower-slot {
    min-width: 0;
}

.collection-flower {
    --flower-color: #7fbd4a;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.24rem;
    min-width: 0;
    min-height: 9rem;
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--flower-color) 48%, transparent);
    border-radius: 0.8rem;
    background:
        radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--flower-color) 13%, transparent), transparent 44%),
        rgba(255, 250, 220, 0.045);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
    color: #fff8df;
    text-align: center;
    transform: none;
    backdrop-filter: none;
}

.collection-flower:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--flower-color) 86%, #fff2bd);
    background:
        radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--flower-color) 22%, transparent), transparent 48%),
        rgba(255, 250, 220, 0.075);
}

.collection-flower.is-selected {
    border-color: #ffe27d;
    box-shadow: 0 0 0 2px rgba(255, 226, 125, 0.24), inset 0 1px rgba(255, 255, 255, 0.08);
}

.collection-flower.is-locked {
    background: rgba(20, 22, 17, 0.42);
    opacity: 0.72;
}

.collection-flower-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 0.85rem;
}

.collection-flower-number {
    color: #aaa793;
    font: 800 0.56rem/1 system-ui, sans-serif;
    letter-spacing: 0.04em;
}

.collection-new-badge,
.collection-rarity-dot {
    padding: 0.13rem 0.26rem;
    border-radius: 999px;
    background: var(--flower-color);
    color: #20180b;
    font: 900 0.48rem/1 system-ui, sans-serif;
    letter-spacing: 0.04em;
}

.collection-new-badge {
    background: #ffe27d;
    box-shadow: 0 0 8px rgba(255, 226, 125, 0.48);
}

.collection-bloom {
    --petal-color: #fffdf4;
    --center-color: #f4cb3c;
    --petal-shadow: #fff7c9;
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 3.15rem;
    height: 3.15rem;
    margin: 0.16rem auto 0.22rem;
    filter: drop-shadow(0 3px 3px rgba(5, 10, 4, 0.34));
}

.collection-bloom.is-large {
    width: 5.8rem;
    height: 5.8rem;
}

.collection-bloom-petal {
    position: absolute;
    top: 1%;
    left: 34%;
    width: 32%;
    height: 51%;
    border: 1px solid color-mix(in srgb, var(--petal-shadow) 62%, transparent);
    border-radius: 70% 70% 48% 48%;
    background: linear-gradient(var(--petal-shadow), var(--petal-color));
    transform: rotate(var(--petal-angle));
    transform-origin: 50% 98%;
}

.collection-bloom-center {
    position: absolute;
    inset: 35%;
    border: 1px solid rgba(77, 48, 14, 0.22);
    border-radius: 50%;
    background: var(--center-color);
    box-shadow: inset 0 0.18rem rgba(255, 255, 255, 0.24), 0 1px 2px rgba(28, 20, 5, 0.32);
}

.collection-bloom.is-locked {
    filter: grayscale(1) brightness(0.34) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.collection-flower-name {
    display: -webkit-box;
    min-height: 1.75rem;
    overflow: hidden;
    color: #fff8df;
    font-size: 0.69rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.collection-flower-mastery {
    overflow: hidden;
    max-width: 100%;
    color: color-mix(in srgb, var(--flower-color) 78%, #e8e1c3);
    font-size: 0.52rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-flower-count {
    position: absolute;
    right: 0.4rem;
    bottom: 0.36rem;
    min-width: 1.65rem;
    padding: 0.17rem 0.3rem;
    border-radius: 999px;
    background: rgba(12, 18, 10, 0.75);
    color: #ffe27d;
    font-size: 0.58rem;
    font-weight: 800;
}

.collection-detail {
    min-width: 0;
    min-height: 0;
    padding: 0.85rem;
    overflow-y: auto;
    border: 1px solid rgba(255, 226, 126, 0.16);
    border-radius: 0.9rem;
    background:
        radial-gradient(circle at 50% 20%, rgba(209, 162, 65, 0.1), transparent 38%),
        rgba(9, 20, 12, 0.54);
}

.collection-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.collection-detail-number {
    color: #b7b29d;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.collection-detail-rarity,
.collection-detail-status {
    --flower-color: #c49a43;
    padding: 0.23rem 0.42rem;
    border: 1px solid color-mix(in srgb, var(--flower-color) 58%, transparent);
    border-radius: 999px;
    color: var(--flower-color);
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.collection-detail-hero {
    display: grid;
    grid-template-columns: 5.8rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.55rem;
}

.collection-detail-identity h3,
.collection-detail > h3 {
    margin: 0;
    color: #fff4ce;
    font: 700 1.15rem/1.05 Georgia, serif;
}

.collection-detail-identity em {
    display: block;
    margin-top: 0.22rem;
    color: #b9b29e;
    font: italic 0.66rem/1.2 Georgia, serif;
}

.collection-detail-identity p,
.collection-detail-copy {
    margin: 0.48rem 0 0;
    color: #d4cfb8;
    font-size: 0.64rem;
    line-height: 1.4;
}

.collection-detail > .collection-bloom.is-large {
    margin-top: 1.25rem;
}

.collection-detail > h3,
.collection-detail-copy,
.collection-detail-empty {
    text-align: center;
}

.collection-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.7rem;
}

.collection-detail-stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.45rem 0.25rem;
    border: 1px solid rgba(255, 230, 145, 0.11);
    border-radius: 0.5rem;
    background: rgba(255, 247, 211, 0.035);
    text-align: center;
}

.collection-detail-stat strong {
    overflow: hidden;
    color: #ffe27d;
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-detail-stat small {
    margin-top: 0.12rem;
    color: #a9a58f;
    font-size: 0.48rem;
    line-height: 1.2;
}

.collection-mastery {
    margin-top: 0.65rem;
    padding: 0.62rem;
    border: 1px solid rgba(255, 214, 97, 0.16);
    border-radius: 0.65rem;
    background: rgba(78, 58, 19, 0.22);
}

.collection-mastery-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.collection-mastery-heading strong {
    color: #f6e2a4;
    font-size: 0.64rem;
}

.collection-mastery-heading span {
    color: #c8a84e;
    font-size: 0.54rem;
    font-weight: 800;
}

.collection-mastery-track {
    display: block;
    height: 0.3rem;
    margin: 0.42rem 0 0.35rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(7, 15, 8, 0.68);
}

.collection-mastery-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #83aa4f, #f1bd43);
}

.collection-mastery > small {
    color: #aaa48d;
    font-size: 0.53rem;
}

.collection-provenance {
    margin-top: 0.62rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 232, 154, 0.1);
}

.collection-provenance p {
    margin: 0;
    color: #c6c0a8;
    font-size: 0.58rem;
}

.collection-habitat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-top: 0.42rem;
}

.collection-habitat-tags span {
    padding: 0.22rem 0.38rem;
    border-radius: 999px;
    background: rgba(114, 145, 77, 0.2);
    color: #cfe2a8;
    font-size: 0.52rem;
    font-weight: 700;
}

.collection-empty {
    grid-column: 1 / -1;
    align-self: center;
    margin: 1rem auto;
    max-width: 27rem;
    color: #d4ddbf;
    line-height: 1.5;
    text-align: center;
}

.collection-detail-empty {
    margin: 2rem auto;
    color: #b8b49f;
    font-size: 0.72rem;
}

.intro-card h2 {
    margin: 0.1rem 0 0.65rem;
    color: #ffe27d;
    font: 700 clamp(2.3rem, 9vw, 4.3rem)/0.9 Georgia, serif;
    letter-spacing: -0.07em;
}

.intro-card p {
    margin: 0.5rem 0;
    color: #f0ebd3;
    font-size: clamp(0.82rem, 2.2vw, 1rem);
    line-height: 1.55;
}

.intro-card .eyebrow {
    margin: 0;
    color: #b7d48a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.intro-progress {
    display: flex;
    justify-content: center;
    gap: 0.38rem;
    min-height: 0.55rem;
    margin: 0 0 0.8rem;
}

.intro-progress[hidden] { display: none; }

.intro-progress-dot {
    width: 0.42rem;
    height: 0.42rem;
    border: 1px solid rgba(255, 226, 126, 0.45);
    border-radius: 50%;
    background: rgba(255, 247, 210, 0.08);
}

.intro-progress-dot.is-active {
    border-color: #ffe27d;
    background: #e3ad3e;
    box-shadow: 0 0 12px rgba(239, 183, 65, 0.5);
}

.intro-step-card {
    display: grid;
    min-height: 14rem;
    align-content: center;
    justify-items: center;
    padding: 1.1rem clamp(0.7rem, 4vw, 1.5rem);
    border: 1px solid rgba(255, 225, 126, 0.18);
    border-radius: 1rem;
    background:
        radial-gradient(circle at 50% 0, rgba(223, 166, 57, 0.12), transparent 46%),
        rgba(255, 248, 210, 0.04);
    text-align: center;
}

.intro-icon {
    display: grid;
    width: 4.8rem;
    height: 4.2rem;
    margin-bottom: 0.85rem;
    clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
    background: linear-gradient(145deg, #e6aa37, #80501f);
    color: #fff1aa;
    font-size: 1.85rem;
    font-weight: 900;
    place-items: center;
    filter: drop-shadow(0 8px 16px rgba(4, 12, 5, 0.44));
}

.intro-step-card .eyebrow {
    margin-bottom: 0.32rem;
}

.intro-step-card h2 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.8rem, 8vw, 3.35rem);
    letter-spacing: -0.045em;
}

.intro-step-card p:not(.eyebrow) {
    max-width: 25rem;
    min-height: 3rem;
    margin: 0;
    font-size: clamp(0.82rem, 2.4vw, 1rem);
    font-weight: 700;
}

.intro-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.intro-actions .primary-button {
    margin: 0;
    min-width: 7.4rem;
}

.intro-card small {
    display: block;
    margin-top: 0.8rem;
    color: rgba(226, 232, 204, 0.64);
    font-size: 0.68rem;
}

.primary-button {
    padding: 0.8rem 1.25rem;
    border-color: rgba(255, 226, 120, 0.72);
    background: #d89b32;
    color: #261b0b;
    font-size: 0.9rem;
}

.primary-button:hover:not(:disabled) { background: #f0bd4d; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 620px), (max-height: 520px) {
    .game-toolbar {
        top: 0.35rem;
        gap: 0.25rem;
    }

    .game-toolbar button {
        padding: 0.42rem 0.58rem;
        font-size: 0.65rem;
    }

    .game-toolbar .toolbar-hex-button {
        flex-basis: 2.2rem;
        width: 2.2rem;
        height: 1.95rem;
        padding: 0;
        font-size: 0.95rem;
    }

    .save-indicator { display: none; }

    .intro-card {
        max-height: calc(100% - 1rem);
        overflow-y: auto;
        padding: 1rem 1.15rem;
    }

    .intro-progress { margin-bottom: 0.55rem; }

    .intro-step-card {
        min-height: 10.5rem;
        padding: 0.75rem;
    }

    .intro-icon {
        width: 3.65rem;
        height: 3.15rem;
        margin-bottom: 0.55rem;
        font-size: 1.4rem;
    }

    .intro-step-card p:not(.eyebrow) {
        min-height: 2.3rem;
        font-size: 0.74rem;
    }

    .collection-panel {
        width: calc(100% - 0.7rem);
        height: calc(100% - 0.7rem);
        max-height: none;
        padding: 0.7rem;
    }

    .collection-header h2 { font-size: 1.3rem; }

    .collection-summary { font-size: 0.66rem; }

    .collection-filters {
        margin: 0.42rem 0;
    }

    .collection-filters button {
        padding: 0.35rem 0.5rem;
        font-size: 0.56rem;
    }

    .collection-body { gap: 0.5rem; }

    .collection-list {
        grid-template-columns: repeat(auto-fill, minmax(5.65rem, 1fr));
        gap: 0.38rem;
    }

    .collection-flower {
        min-height: 8rem;
        padding: 0.4rem;
    }

    .collection-bloom {
        width: 2.65rem;
        height: 2.65rem;
    }

    .queen-panel {
        width: calc(100% - 0.7rem);
        max-height: calc(100% - 0.7rem);
        padding: 0.82rem;
    }

    .queen-portrait {
        flex-basis: 3.45rem;
        width: 3.45rem;
        height: 3rem;
    }
}

@media (max-width: 620px) {
    .collection-rarity-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(12rem, 0.92fr) minmax(12rem, 1.08fr);
    }

    .collection-detail {
        padding: 0.72rem;
    }

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

    .queen-vitality {
        grid-template-columns: 1fr;
    }
}

@media (orientation: portrait) {
    .game-shell {
        width: 100vw;
        height: 100dvh;
        min-width: 0;
    }

    #gameCanvas { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
    button { transition: none; }
}
