dialog {
    color:var(--ink);
    border:1px solid #e1e3d7;
    border-radius:24px;
    background:var(--paper);
    padding:27px;
    max-width:600px;
    width:calc(100% - 32px);
    max-height:85dvh;
    box-shadow:0 25px 90px #26392040;
    overflow:auto
}
dialog::backdrop {
    background:#273a3066;
    backdrop-filter:blur(4px)
}
.dialog-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-bottom:25px
}
.dialog-heading h2 {
    font-family:Georgia,serif;
    font-size:31px;
    font-weight:500;
    margin-top:8px
}
.dialog-heading .icon-button {
    flex:none
}
.dialog-description {
    font-size:13px;
    color:var(--muted);
    line-height:1.8;
    margin-bottom:20px
}
.form-error {
    font-size:12px;
    color:#a73f32;
    margin-top:12px
}
.avatar-grid {
    display:grid;
    grid-template-columns:repeat(6,1fr);
    gap:8px;
    margin:11px 0 20px
}
.avatar-option {
    border:1px solid var(--line);
    border-radius:12px;
    padding:7px;
    background:var(--card);
    min-height:48px
}
.avatar-option img {
    height:45px;
    width:100%;
    object-fit:contain
}
.avatar-option[aria-pressed=true] {
    border:2px solid var(--green);
    background:#e8eeda
}
.form-actions {
    display:flex;
    justify-content:flex-end;
    gap:10px;
    flex-wrap:wrap;
    margin-top:22px
}
.tabs {
    display:flex;
    gap:5px;
    background:#e9ebdd;
    border-radius:11px;
    padding:4px;
    margin-bottom:20px;
    overflow-x:auto
}
.tabs button {
    flex:1;
    padding:9px 12px;
    border-radius:8px;
    font-size:11px;
    white-space:nowrap;
    min-height:42px
}
.tabs button[aria-selected=true] {
    background:var(--card);
    box-shadow:0 2px 5px #53633810
}
.stats-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px
}
.metric-card {
    background:var(--card);
    border:1px solid var(--line);
    padding:17px;
    border-radius:14px
}
.metric-card span {
    display:block;
    color:var(--muted);
    font-size:11px
}
.metric-card strong {
    display:block;
    font-size:24px;
    font-weight:600;
    margin-top:5px
}
.achievement-list {
    display:grid;
    gap:10px
}
.achievement-row {
    display:flex;
    gap:14px;
    border:1px solid var(--line);
    padding:16px;
    border-radius:15px;
    background:var(--card)
}
.achievement-row.unlocked {
    border-color:#b8c6a4;
    background:#f4f7e9
}
.achievement-row .badge-icon {
    width:40px;
    height:45px
}
.achievement-copy {
    flex:1;
    min-width:0
}
.achievement-copy h3 {
    font-size:14px
}
.achievement-copy p {
    font-size:11px;
    color:var(--muted);
    margin:5px 0 9px
}
.achievement-meta {
    display:flex;
    justify-content:space-between;
    gap:10px;
    font-size:9px;
    color:var(--muted);
    margin-top:8px
}
.achievement-copy progress {
    display:block;
    width:100%;
    height:5px;
    accent-color:#708b5a
}
.setting-row {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:24px;
    padding:18px 0;
    border-bottom:1px solid var(--line)
}
.setting-row label {
    margin:0;
    font-size:13px
}
.setting-row p {
    font-size:11px;
    color:var(--muted);
    margin-top:4px
}
.setting-row input[type=checkbox] {
    width:23px;
    height:23px;
    min-height:23px;
    accent-color:var(--green);
    flex:none
}
.setting-row input[type=range] {
    width:150px;
    max-width:45%;
    padding:0;
    accent-color:var(--green)
}
.danger-zone {
    margin-top:24px;
    display:grid;
    gap:10px
}
.danger-zone button {
    text-align:left
}
.toast-host {
    position:fixed;
    bottom:22px;
    right:22px;
    z-index:100;
    display:grid;
    gap:10px;
    max-width:340px;
    pointer-events:none
}
.toast {
    background:#fffdf5;
    border:1px solid #d9dfc9;
    box-shadow:0 10px 40px #273e2629;
    padding:15px 21px;
    border-radius:14px;
    animation:spawn .2s ease-out;
    font-size:12px
}
.toast strong {
    display:block;
    font-size:13px;
    color:var(--green)
}
.toast small {
    color:var(--muted)
}
.game-over-hero {
    text-align:center;
    padding-bottom:20px
}
.game-over-hero img {
    height:95px;
    width:90px;
    object-fit:contain;
    margin:auto
}
.game-over-hero strong {
    font-size:48px;
    display:block;
    letter-spacing:-2px
}
.game-over-hero p {
    color:var(--muted);
    font-size:12px
}
.account-avatar {
    height:80px;
    margin:0 auto 15px
}
.recovery-note {
    font-size:12px;
    color:var(--muted);
    background:#edeedf;
    padding:15px;
    border-radius:12px;
    margin:15px 0
}
.empty-state {
    padding:40px 20px;
    text-align:center
}
.empty-state img {
    height:100px;
    margin:auto auto 18px
}
.empty-state h3 {
    font-family:Georgia,serif;
    font-size:27px;
    font-weight:500
}
.empty-state p {
    font-size:13px;
    color:var(--muted);
    margin:12px 0 24px
}

/* Character avatar selection — separate from permanent fruit team. */
.character-avatar-field {
    margin-top: 20px;
}
.character-avatar-field > label {
    display: block;
    margin-bottom: 4px;
}
.character-avatar-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.character-avatar-option {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 2px solid rgba(71, 91, 61, .12);
    border-radius: 18px;
    background: rgba(255,255,255,.88);
    color: inherit;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.character-avatar-option:hover {
    transform: translateY(-1px);
    border-color: rgba(115, 151, 78, .42);
}
.character-avatar-option[aria-pressed="true"] {
    border-color: #85aa55;
    box-shadow: 0 0 0 3px rgba(133,170,85,.14);
    background: #fbfff4;
}
.character-avatar-option img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 14px;
}
.character-avatar-option span {
    min-width: 0;
    line-height: 1.25;
}
@media (max-width: 520px) {
    .character-avatar-grid {
        grid-template-columns: 1fr;
    }
}

.account-avatar-character {
    width:150px;
    height:150px;
    object-fit:contain;
    border-radius:28px;
    background:linear-gradient(180deg,#fffdf5 0%,#edf3df 100%);
    border:1px solid var(--line);
    box-shadow:0 16px 36px rgba(71,77,57,.12);
    padding:6px;
}
.account-character-name {
    margin:-2px 0 10px;
    text-align:center;
    font-weight:700;
    color:var(--ink);
}
.account-team-line {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    margin:0 0 14px;
    color:var(--muted);
    font-size:12px;
    font-weight:650;
}
.account-team-line img {
    width:22px;
    height:22px;
    object-fit:contain;
}

/* Picnic basket power-up overlay */
dialog.basket-dialog {
    max-width:790px;
    padding:28px;
}
dialog.basket-dialog .dialog-heading {
    margin-bottom:18px;
}
.basket-rescue-alert {
    display:flex;
    align-items:center;
    gap:10px;
    margin:0 0 14px;
    padding:11px 14px;
    border:1px solid #e5c6ad;
    border-radius:14px;
    background:#fff5e9;
    color:#865a3d;
    font-size:11px;
}
.basket-rescue-alert strong {
    color:#74462c;
}
.basket-overlay-intro {
    display:grid;
    grid-template-columns:150px minmax(0,1fr);
    gap:24px;
    align-items:center;
    margin-bottom:24px;
    padding:20px 22px;
    border:1px solid #dcdbc5;
    border-radius:22px;
    background:
        radial-gradient(circle at 88% 15%,rgba(255,255,255,.8),transparent 35%),
        linear-gradient(135deg,#f8efda 0%,#f4f6e8 100%);
}
.basket-overlay-art {
    display:grid;
    place-items:center;
    min-height:118px;
    border-radius:19px;
    background:rgba(255,255,255,.5);
    border:1px solid rgba(255,255,255,.8);
}
.basket-overlay-art img {
    width:138px;
    height:108px;
    object-fit:contain;
}
.basket-overlay-copy h3 {
    margin:5px 0 5px;
    font-family:Georgia,serif;
    font-size:27px;
    font-weight:500;
    letter-spacing:-.45px;
}
.basket-overlay-copy p {
    margin:0;
    color:var(--muted);
    font-size:12px;
    line-height:1.65;
}
.basket-summary {
    display:flex;
    gap:7px;
    flex-wrap:wrap;
    margin-top:12px;
}
.basket-summary span {
    display:inline-flex;
    align-items:center;
    gap:5px;
    padding:6px 8px;
    border:1px solid #dfe1cf;
    border-radius:999px;
    background:rgba(255,255,255,.66);
    color:#717967;
    font-size:9px;
}
.basket-summary strong {
    color:#5f704f;
    font-size:10px;
}
.basket-section-heading {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    margin:0 2px 12px;
}
.basket-section-heading h3 {
    margin:4px 0 0;
    font-family:Georgia,serif;
    font-size:21px;
    font-weight:500;
}
.basket-section-heading>span {
    color:var(--muted);
    font-size:9px;
    font-weight:700;
}
.basket-power-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.basket-power-card {
    display:flex;
    flex-direction:column;
    min-width:0;
    min-height:236px;
    padding:15px;
    border:1px solid #dadcc8;
    border-radius:18px;
    background:#fffdf7;
    box-shadow:0 8px 20px rgba(71,77,57,.045);
    transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.basket-power-card.is-available:hover {
    transform:translateY(-2px);
    border-color:#c3c9aa;
    box-shadow:0 12px 27px rgba(71,77,57,.08);
}
.basket-power-card.is-unavailable {
    background:#f6f6ef;
    color:#8c9084;
}
.basket-power-card.is-empty {
    border-style:dashed;
}
.basket-power-top {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:13px;
}
.basket-power-icon {
    width:58px;
    height:58px;
    display:grid;
    place-items:center;
    border-radius:17px;
    background:linear-gradient(145deg,#eaf0dd,#f7f3df);
    color:#617550;
    font-size:27px;
    font-weight:600;
    box-shadow:inset 0 0 0 1px rgba(130,145,105,.11);
}
.basket-power-card.is-unavailable .basket-power-icon {
    filter:grayscale(.35);
    opacity:.72;
}
.basket-power-status {
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:3px;
}
.basket-power-count {
    display:grid;
    place-items:center;
    min-width:38px;
    height:38px;
    padding:0 8px;
    border-radius:999px;
    background:#72885d;
    color:#fff;
    font-size:14px;
    font-weight:800;
    box-shadow:0 5px 14px rgba(94,113,75,.16);
}
.basket-power-card.is-empty .basket-power-count {
    background:#a6aa9a;
}
.basket-power-status small {
    color:#838978;
    font-size:8px;
    font-weight:750;
    text-transform:uppercase;
    letter-spacing:.06em;
}
.basket-power-copy {
    min-width:0;
    flex:1;
}
.basket-power-copy h3 {
    margin:0 0 6px;
    font-family:Georgia,serif;
    font-size:20px;
    font-weight:500;
}
.basket-power-copy p {
    margin:0 0 8px;
    color:var(--muted);
    font-size:11px;
    line-height:1.55;
}
.basket-power-note {
    color:#7a826e;
    font-size:9px;
    font-weight:650;
}
.basket-power-use {
    width:100%;
    min-height:42px;
    margin-top:15px;
}
.basket-recovery-footer {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-top:15px;
    padding-top:15px;
    border-top:1px solid var(--line);
}
.basket-recovery-footer>span {
    color:var(--muted);
    font-size:10px;
}
.basket-inventory-footnote {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-top:16px;
    padding:13px 2px 0;
    border-top:1px solid var(--line);
    color:var(--muted);
    font-size:10px;
}
.basket-inventory-footnote a {
    flex:none;
    color:#61744f;
    font-weight:750;
}
.basket-inventory-footnote a:hover {
    text-decoration:underline;
}
