/* =================================================================
   MINI GARDEN - STYLESHEET (Phase 2)
   Struktur:
   1. Reset & base
   2. Login screen
   3. Layout shell & top bar
   4. TAS floating button
   5. Selection view
   6. Rarity badges
   7. Garden view & plant visual (crossfade, sway, bounce, bloom)
   8. Action buttons
   9. Modals (confirm, reward, histori, tas)
   10. Dev panel
   11. Toast
   12. Animations
   13. Responsive breakpoints
   14. Reduced motion
   ================================================================= */

/* ---------- 1. RESET & BASE ---------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    background:
        linear-gradient(rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.18)),
        url("background.webp");

    background-size: cover;
    background-position: center;
    background-attachment: fixed;

    font-family: Arial, sans-serif;

    padding: 20px 12px;
}

button {
    font-family: inherit;
}

h1, h2 {
    margin: 0;
}

.empty-state {
    color: #888;
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

.tas-empty-state p {
    margin: 4px 0;
}

.tas-empty-state p:first-child {
    font-weight: bold;
    color: #666;
}

/* ---------- 2. LOGIN / BEFORE-LOGIN LANDING SCREEN ---------- */

.landing-shell {
    width: 100%;
    display: flex;
    justify-content: center;
}

.landing-shell[hidden] {
    display: none;
}

.landing-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 4px 40px;
}

/* ---- Logo besar sebagai visual anchor di tengah-atas ---- */
.landing-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 22px;
}

.landing-logo {
    width: clamp(220px, 34vw, 420px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(35, 25, 10, 0.28));
    animation: landingLogoFloat 4.5s ease-in-out infinite;
}

.landing-logo-caption {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: bold;
    color: #3f6b1f;
    background: rgba(255, 255, 255, 0.72);
    padding: 5px 14px;
    border-radius: 999px;
}

@keyframes landingLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---- Dua kolom: konten kiri (info + tanaman) & login kanan ---- */
.landing-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.section-header-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.section-header-img {
    width: clamp(220px, 60%, 320px);
    height: auto;
    object-fit: contain;
}

/* ---- Tentang Permainan: 4 kartu info ---- */
.info-section {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    padding: 20px 16px 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.info-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.info-card {
    background: linear-gradient(180deg, #fdfcf6 0%, #f4f7ea 100%);
    border-radius: 18px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 6px 14px rgba(35, 60, 20, 0.08);
    transition: transform 0.15s ease;
}

.info-card-icon {
    width: 46px;
    height: 46px;
    object-fit: contain;
    margin-bottom: 8px;
}

.info-card h3 {
    margin: 0 0 4px;
    font-size: 13.5px;
    color: #3f6b1f;
}

.info-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #666;
}

/* ---- Pilihan Tanaman: 3 kartu bunga ---- */
.plant-section {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 26px;
    padding: 20px 16px 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.plant-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.plant-showcase-card {
    background: linear-gradient(180deg, #fdfcf6 0%, #f4f7ea 100%);
    border-radius: 18px;
    padding: 14px 8px 16px;
    text-align: center;
    box-shadow: 0 6px 14px rgba(35, 60, 20, 0.08);
}

.plant-showcase-img {
    width: 100%;
    max-width: 92px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 8px;
}

.plant-showcase-name {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
}

.plant-name-rose { background: #d9556a; }
.plant-name-sunflower { background: #e0a530; }
.plant-name-tulip { background: #d871a8; }

.plant-showcase-card p {
    margin: 0;
    font-size: 11.5px;
    color: #666;
}

/* ---- Login card ---- */
.landing-right {
    display: flex;
}

.login-card {
    position: relative;
    width: 100%;

    padding: 24px 22px 28px;
    text-align: center;

    background: rgba(251, 250, 243, 0.92);

    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);

    box-shadow: 0 20px 45px rgba(35, 60, 20, 0.22);

    animation: modalPop 0.35s cubic-bezier(.25, .8, .4, 1);
}

.login-card-title {
    margin: 0;
    font-size: 19px;
    line-height: 1.3;
    color: #2f4a1a;
}

.login-card-title span {
    color: #4d8f1a;
}

.login-tagline {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: bold;
    color: #6b7d4a;
}

.field-label {
    display: block;
    text-align: left;
    font-size: 13px;
    font-weight: bold;
    color: #444;
    margin: 14px 0 6px;
}

.text-input {
    width: 100%;
    padding: 13px 14px;

    border: 2px solid #e2e2e2;
    border-radius: 14px;

    font-size: 15px;

    background: #fff;
}

.text-input:focus {
    outline: none;
    border-color: #8bdc1b;
}

.login-error {
    min-height: 18px;
    margin: 10px 0 4px;

    color: #c0392b;
    font-size: 13px;
    font-weight: bold;
}

.login-card .btn-primary {
    margin-top: 14px;
}

.login-hint {
    margin-top: 14px;
    margin-bottom: 0;

    font-size: 11.5px;
    color: #999;
}

.login-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---- Hubungi Admin (di dalam login card) ---- */
.hubungi-admin-block {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
    padding: 10px 14px;

    border: 1px solid #e6e9da;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    text-align: left;
}

.hubungi-admin-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.hubungi-admin-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.hubungi-admin-text b {
    font-size: 12.5px;
    color: #3f6b1f;
}

.hubungi-admin-text small {
    font-size: 11px;
    color: #888;
}

.login-register-line {
    margin: 16px 0 0;
    padding-top: 14px;

    border-top: 1px solid #e6e9da;

    font-size: 13px;
    color: #666;
}

.login-register-link {
    color: #4d8f1a;
    font-weight: bold;
    text-decoration: underline;
}

/* ---------- 2b. LIVECHAT FLOATING BUTTON ---------- */
/* Icon jadi elemen visual utama - tanpa lingkaran putih besar, kontainer
   transparan minimal, hanya drop-shadow lembut + hover scale ringan. */

.livechat-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;

    width: 58px;
    height: 58px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: transparent;

    cursor: pointer;

    z-index: 5000;
}

/* Di layar before-login sudah ada blok "HUBUNGI ADMIN" di dalam login card
   (lihat .hubungi-admin-block) - FAB mengambang jadi redundan dan berisiko
   menutupi tombol LOGIN di layar mobile yang pendek. Sembunyikan FAB HANYA
   saat landing/login screen sedang tampil; begitu masuk game, FAB tetap
   muncul seperti semula (tidak ada perubahan behavior setelah login). */
#loginScreen:not([hidden]) ~ .livechat-fab {
    display: none;
}

.livechat-fab-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;

    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));

    transition: transform 0.15s ease, filter 0.15s ease;
}

.livechat-fab:hover .livechat-fab-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.livechat-fab:active .livechat-fab-icon {
    transform: scale(0.97);
}

.livechat-modal-card {
    text-align: left;
}

/* ---------- 3. LAYOUT SHELL & TOP BAR ---------- */

.game-shell {
    position: relative;

    width: min(440px, calc(100vw - 24px));
    padding: 20px;

    background: rgba(255, 255, 255, 0.90);

    border-radius: 25px;

    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.30);

    backdrop-filter: blur(6px);
}

.top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;

    margin-bottom: 8px;
    padding-right: 44px; /* beri ruang utk dev-toggle di pojok */
}

.player-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.username-display {
    font-weight: bold;
    font-size: 15px;
    color: #2d5a3d;

    background: #eef7e6;
    border-radius: 14px;
    padding: 6px 12px;

    white-space: nowrap;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-block-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-btn {
    border: none;
    border-radius: 12px;

    background: #eef1ea;
    color: #444;

    font-size: 11.5px;
    font-weight: bold;

    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.logout-btn {
    border: none;
    background: transparent;

    color: #999;
    font-size: 11px;
    text-decoration: underline;

    cursor: pointer;
    padding: 4px 2px;
}

.resource-block {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inv-badge {
    padding: 8px 14px;

    background: #e8f7ff;

    border-radius: 20px;

    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
}

#fertilizerBadge {
    background: #fff3d9;
}

.dev-toggle {
    position: absolute;
    top: 16px;
    right: 16px;

    border: none;
    border-radius: 14px;

    background: #444;
    color: #fff;

    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;

    padding: 8px 10px;

    cursor: pointer;
    opacity: 0.55;
}

.dev-toggle:hover {
    opacity: 1;
}

.game-main {
    width: 100%;
}

/* ---------- 4. TAS FLOATING BUTTON ---------- */

.tas-fab {
    position: absolute;
    top: 74px;
    right: 12px;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;

    border: 2px solid #fff;
    border-radius: 16px;

    background: linear-gradient(#ffcf5c, #f5a623);
    color: #4a3300;

    padding: 8px 10px;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);

    cursor: pointer;
    font-weight: bold;

    z-index: 50;
}

.tas-fab-emoji {
    font-size: 20px;
    line-height: 1;
}

.tas-fab-label {
    font-size: 10px;
}

/* ---------- 5. SELECTION VIEW ---------- */

.selection-view {
    text-align: center;
}

.game-title {
    margin-bottom: 4px;
    font-size: 24px;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 18px;
    color: #666;
}

.flower-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.flower-card {
    text-align: left;
    padding: 16px;

    background: #ffffff;

    border-radius: 18px;
    border: 2px solid #eee;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.flower-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

/* Thumbnail dibesarkan (P6) - jadi preview tanaman yang benar-benar
   terlihat, bukan icon kecil 46x46. object-fit: contain supaya artwork
   tidak pernah ter-crop/stretch. */
.flower-card-thumb {
    width: clamp(64px, 20vw, 84px);
    height: clamp(64px, 20vw, 84px);
    object-fit: contain;
    flex-shrink: 0;
}

.flower-card-thumb.plant-thumb-emoji {
    font-size: 46px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flower-card-name {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.flower-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;

    font-size: 13px;
    color: #555;

    margin-bottom: 12px;
}

.flower-card-details b {
    color: #222;
}

.flower-card button {
    width: 100%;
    padding: 12px;

    border: none;
    border-radius: 14px;

    background: linear-gradient(#8bdc1b, #4caf0c);
    color: white;

    font-size: 15px;
    font-weight: bold;

    cursor: pointer;

    box-shadow: 0 4px 0 #367d09;

    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.flower-card button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #367d09;
}

/* ---------- 6. RARITY BADGES ---------- */

.rarity-badge {
    display: inline-block;
    padding: 3px 10px;
    margin-top: 3px;

    border-radius: 12px;

    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.rarity-common {
    background: #eef3e9;
    color: #4c6b3a;
    border: 1px solid #cdddc0;
}

.rarity-rare {
    background: #e6f0fb;
    color: #2b5c9e;
    border: 1px solid #bcd7f2;
}

.rarity-epic {
    background: #f3ebfa;
    color: #7a3fa8;
    border: 1px solid #ddc4ef;
}

.flower-card.rarity-border-common { border-color: #cdddc0; }
.flower-card.rarity-border-rare { border-color: #bcd7f2; }
.flower-card.rarity-border-epic {
    border-color: #ddc4ef;
    box-shadow: 0 4px 14px rgba(122, 63, 168, 0.12);
}

/* ---------- 7. GARDEN VIEW & PLANT VISUAL ---------- */

.garden-view {
    text-align: center;
}

.plant-identity {
    display: flex;
    align-items: center;
    gap: 10px;

    text-align: left;
    margin-bottom: 6px;
}

/* Header identitas tanaman aktif - asset final (BUKAN emoji). */
.plant-header-thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-header-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.plant-header-thumb-img.plant-thumb-emoji {
    font-size: 28px;
}

.plant-identity-text h2 {
    font-size: 19px;
    line-height: 1.1;
}

.plant-stage-area {
    position: relative;
    height: 300px;

    display: flex;
    justify-content: center;
    align-items: flex-end;

    margin-top: 8px;
}

.plant-visual {
    position: relative;
    width: 260px;
    height: 260px;
}

.plant-visual-layer {
    position: absolute;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: flex-end;

    opacity: 0;
    transition: opacity 0.35s ease;
}

.plant-visual-layer.visible {
    opacity: 1;
}

/* Idle sway (infinite) HIDUP DI WRAPPER. Reaction (bounce/bloom-pop) HIDUP
   DI ELEMEN ANAK (.plant-image). Dua elemen DOM berbeda = dua property
   `animation` yang berbeda, transform-nya digabung otomatis oleh browser
   (transform wrapper x transform image) tanpa pernah saling menimpa. */

.plant-sway-wrapper {
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: flex-end;

    transform-origin: bottom center;
}

.plant-sway-wrapper.sway-healthy {
    animation: swayHealthy 3.6s cubic-bezier(.45, 0, .55, 1) infinite;
}

.plant-sway-wrapper.sway-thirsty {
    animation: swayThirsty 4.6s cubic-bezier(.45, 0, .55, 1) infinite;
}

.plant-sway-wrapper.sway-wilted {
    animation: swayWilted 6s ease-in-out infinite;
}

.plant-sway-wrapper.sway-bloom {
    animation: swayHealthy 3.8s cubic-bezier(.45, 0, .55, 1) infinite,
               bloomGlowSoft 2.4s ease-in-out infinite alternate;
}

.plant-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;

    transform-origin: bottom center;
}

img.plant-image {
    width: 100%;
    height: 100%;
}

.plant-emoji-visual {
    font-size: 90px;
    line-height: 1;
}

/* Reaction - dipicu sesaat lalu class-nya dibersihkan lewat 'animationend'
   di app.js. Tidak pernah dibiarkan menempel permanen. */
.plant-image.do-bounce {
    animation: bounceSquash 0.45s cubic-bezier(.34, 1.56, .64, 1) 1;
}

.plant-image.bloom-pop {
    animation: bloomPop 0.7s cubic-bezier(.25, .8, .35, 1) 1;
}

.stage-message {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);

    padding: 8px 16px;

    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;

    font-weight: bold;
    font-size: 14px;
    color: #318b16;

    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.stage-message.show {
    animation: stagePop 1.2s ease;
}

.status-line {
    font-weight: bold;
    font-size: 15px;
    margin: 4px 0 10px;
}

.status-healthy { color: #318b16; }
.status-thirsty { color: #c68a12; }
.status-wilted { color: #b23a3a; }
.status-bloomed { color: #a83fbf; }

.progress-box {
    width: 100%;
    height: 20px;

    background: #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;

    background: linear-gradient(90deg, #8be21d, #39b51f);

    transition: width 0.6s cubic-bezier(.25, .8, .35, 1);
}

.progress-text {
    font-weight: bold;
    font-size: 13px;
    margin: 6px 0 2px;
}

.info-rows {
    margin-bottom: 6px;
}

.info-row {
    margin: 4px 0;
    font-size: 13px;
    color: #555;
}

.countdown-line {
    font-style: italic;
}

/* ---------- 8. ACTION BUTTONS ---------- */

.action-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.btn-primary {
    width: 100%;
    padding: 15px;

    border: none;
    border-radius: 18px;

    background: linear-gradient(#8bdc1b, #4caf0c);
    color: white;

    font-size: 18px;
    font-weight: bold;

    cursor: pointer;

    box-shadow: 0 5px 0 #367d09;

    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-primary:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #367d09;
}

.btn-primary:disabled {
    cursor: default;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 13px;

    border: none;
    border-radius: 16px;

    background: #eef1ea;
    color: #444;

    font-size: 15px;
    font-weight: bold;

    cursor: pointer;
}

.btn-secondary:disabled {
    cursor: default;
    opacity: 0.55;
}

/* ---------- 9. MODALS ---------- */

.modal-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.45);

    z-index: 9999;
    padding: 16px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-card {
    width: min(340px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    padding: 26px;
    text-align: center;

    background: white;
    border-radius: 24px;

    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);

    animation: modalPop 0.28s cubic-bezier(.25, .8, .4, 1);
}

.modal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 6px;
}

.modal-close-btn {
    border: none;
    background: #f2f2f2;
    border-radius: 10px;

    width: 30px;
    height: 30px;

    font-size: 14px;
    cursor: pointer;
}

.modal-sub {
    font-size: 12.5px;
    color: #777;
    margin: 0 0 12px;
    text-align: left;
}

.modal-line {
    font-size: 14px;
    color: #444;
    margin: 8px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.reward-modal-card h2 {
    color: #45a914;
    margin-bottom: 6px;
}

.reward-amount {
    margin: 16px 0;
    padding: 14px;

    border-radius: 16px;
    background: #f3ffd9;

    font-size: 22px;
    font-weight: bold;
}

/* Histori */

.history-card,
.tas-card {
    text-align: left;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;

    max-height: 320px;
    overflow-y: auto;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;

    background: #f7f9f4;
    border-radius: 12px;

    font-size: 13px;
}

.history-message {
    flex: 1;
}

.history-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

/* TAS */

.tas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;

    max-height: 320px;
    overflow-y: auto;
}

.tas-row {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;

    background: #fdf9ee;
    border-radius: 14px;
    border: 1px solid #f1e6c8;
}

.tas-icon {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex-shrink: 0;
}

.tas-icon.plant-thumb-emoji {
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tas-row-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tas-row-name {
    font-weight: bold;
    font-size: 14px;
}

.tas-count-badge {
    background: #f5a623;
    color: white;

    font-size: 13px;
    font-weight: bold;

    padding: 4px 10px;
    border-radius: 12px;

    white-space: nowrap;
}

/* ---------- 10. DEV PANEL ---------- */

.dev-panel {
    position: fixed;
    top: 12px;
    right: 12px;

    width: min(280px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;

    background: #222;
    color: #eee;

    border-radius: 16px;
    padding: 12px;

    font-size: 12px;

    z-index: 10000;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

.dev-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 10px;
    font-size: 13px;
}

.dev-close {
    background: none;
    border: none;
    color: #eee;
    font-size: 14px;
    cursor: pointer;
}

.dev-section {
    margin-bottom: 10px;
}

.dev-section-title {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9a9a9a;
    margin-bottom: 5px;
}

.dev-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dev-btn {
    flex: 1 1 auto;
    padding: 7px 9px;

    border: 1px solid #444;
    border-radius: 8px;

    background: #333;
    color: #eee;

    font-size: 11px;
    cursor: pointer;
}

.dev-btn:hover {
    background: #3d3d3d;
}

.dev-btn-danger {
    border-color: #7a2b2b;
    background: #4a1f1f;
}

.dev-btn-danger:hover {
    background: #5c2626;
}

/* ---------- 11. TOAST ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);

    background: rgba(30, 30, 30, 0.92);
    color: white;

    padding: 10px 18px;
    border-radius: 14px;

    font-size: 13px;

    opacity: 0;
    pointer-events: none;

    z-index: 10001;

    transition: opacity 0.25s ease, transform 0.25s ease;

    max-width: calc(100vw - 40px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- 12. ANIMATIONS ---------- */

/* Sehat: sway natural & lembut */
@keyframes swayHealthy {
    0%   { transform: rotate(-1.5deg) translateY(0); }
    25%  { transform: rotate(1deg) translateY(-2px); }
    50%  { transform: rotate(1.8deg) translateY(0); }
    75%  { transform: rotate(-0.8deg) translateY(-1.5px); }
    100% { transform: rotate(-1.5deg) translateY(0); }
}

/* Haus: tetap sway, sedikit lebih subtle (durasi lebih lambat diatur di class) */
@keyframes swayThirsty {
    0%   { transform: rotate(-1.1deg) translateY(0); }
    25%  { transform: rotate(0.7deg) translateY(-1.5px); }
    50%  { transform: rotate(1.3deg) translateY(0); }
    75%  { transform: rotate(-0.6deg) translateY(-1px); }
    100% { transform: rotate(-1.1deg) translateY(0); }
}

/* Layu: tetap bergerak tapi lesu - amplitudo kecil, condong ke bawah */
@keyframes swayWilted {
    0%   { transform: rotate(-0.6deg) translateY(0); }
    50%  { transform: rotate(0.5deg) translateY(1px); }
    100% { transform: rotate(-0.6deg) translateY(0); }
}

@keyframes bounceSquash {
    0%   { transform: scale(1, 1); }
    30%  { transform: scale(1.08, 0.92); }
    55%  { transform: scale(0.95, 1.06); }
    100% { transform: scale(1, 1); }
}

@keyframes bloomGlowSoft {
    from { filter: drop-shadow(0 0 4px rgba(255, 150, 180, 0.35)); }
    to   { filter: drop-shadow(0 0 14px rgba(255, 110, 160, 0.7)); }
}

@keyframes bloomPop {
    0%   { transform: scale(0.85); opacity: 0.6; }
    45%  { transform: scale(1.07); opacity: 1; }
    70%  { transform: scale(0.98); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes stagePop {
    0%   { opacity: 0; transform: translateX(-50%) scale(0.7) translateY(10px); }
    25%  { opacity: 1; transform: translateX(-50%) scale(1.08) translateY(0); }
    70%  { opacity: 1; transform: translateX(-50%) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.9) translateY(-10px); }
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* ---------- 13. RESPONSIVE BREAKPOINTS ---------- */

/* background-attachment: fixed bisa berat/patah di scroll mobile - matikan
   di layar kecil/tablet, desktop tetap pakai efek parallax ringan ini. */
@media (max-width: 820px) {
    body {
        background-attachment: scroll;
    }
}

@media (max-width: 430px) {
    .game-shell { padding: 16px; border-radius: 20px; }
    .plant-stage-area { height: 240px; }
    .plant-visual { width: 200px; height: 200px; }
    .tas-fab { top: 100px; right: 8px; }
    .top-bar { padding-right: 40px; }
    .dev-panel { top: 8px; right: 8px; left: 8px; width: auto; }
    .username-display { max-width: 50vw; }

    .landing-inner { padding: 12px 2px 28px; }
    .landing-logo { width: clamp(170px, 60vw, 260px); }
    .login-card { padding: 20px 16px 22px; border-radius: 22px; }
    .info-section, .plant-section { padding: 16px 12px 18px; border-radius: 20px; }
    .plant-card-grid { gap: 8px; }
    .plant-showcase-card { padding: 10px 6px 12px; }
    .livechat-fab { width: 48px; height: 48px; right: 12px; bottom: 12px; }
}

@media (max-width: 390px) {
    .game-title { font-size: 21px; }
    .plant-stage-area { height: 210px; }
    .plant-visual { width: 170px; height: 170px; }
    .resource-block { gap: 6px; }
    .inv-badge { padding: 7px 10px; font-size: 13px; }
}

@media (max-width: 360px) {
    .top-bar { padding-right: 36px; }
    .tas-fab { top: 96px; }
    .player-block-actions { flex-wrap: wrap; }

    .landing-logo { width: clamp(150px, 58vw, 220px); }
    .plant-card-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .plant-showcase-img { max-width: 76px; }
}

/* Layar sangat pendek (mis. landscape HP kecil): jangan biarkan livechat
   menutupi bagian bawah card login / tombol aksi game. */
@media (max-height: 700px) {
    .livechat-fab { width: 46px; height: 46px; right: 10px; bottom: 10px; }
}

@media (min-width: 768px) {
    body { align-items: center; }
    .game-shell { width: 460px; }
}

/* ---- Landing before-login: layout 2 kolom mulai tablet-lebar/desktop ----
   Kiri (Tentang Permainan + Pilihan Tanaman) ~62-65%, kanan (Login) ~32-36%.
   grid-template-areas dipakai supaya urutan visual desktop (info/plant kiri,
   login kanan) tidak tergantung urutan DOM - urutan DOM sengaja dibuat
   login->info->plant supaya di mobile (tanpa area override) login tampil
   PALING ATAS tanpa perlu reorder lewat JS. */
@media (min-width: 900px) {
    .landing-columns {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
        grid-template-areas:
            "info  login"
            "plant login";
        gap: 28px;
        align-items: start;
    }

    .info-section { grid-area: info; }
    .plant-section { grid-area: plant; }
    .landing-right { grid-area: login; }

    .info-card-grid { grid-template-columns: repeat(4, 1fr); }

    .landing-right .login-card { position: sticky; top: 20px; }

    .info-card:hover,
    .plant-showcase-card:hover {
        transform: translateY(-3px);
    }
}

/* ---------- 14. REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
    .plant-sway-wrapper.sway-healthy,
    .plant-sway-wrapper.sway-thirsty,
    .plant-sway-wrapper.sway-wilted,
    .plant-sway-wrapper.sway-bloom,
    .plant-image.do-bounce,
    .plant-image.bloom-pop,
    .stage-message.show,
    .modal-card,
    .login-card {
        animation: none !important;
    }

    .progress-bar,
    .plant-visual-layer {
        transition: none !important;
    }
}


/* =====================================================================
   LOGIN KEYPAD - grid 3 kolom x 4 baris (tepat 12 sel)
   Semua 12 tombol (10 digit + CLEAR + HAPUS) hidup dalam SATU kontainer
   grid (#pinKeys), supaya baris terakhir (CLEAR | digit | HAPUS) selalu
   sejajar dalam grid yang sama - bukan blok terpisah. JS (shuffleStaticPinKeys
   di app.js) hanya memindah-mindah elemen lewat appendChild; CLEAR & HAPUS
   selalu diletakkan balik ke posisi tetapnya (kiri-bawah / kanan-bawah).
   ===================================================================== */
.pin-pad-wrap {
    width: 100%;
}

.pin-display {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 14px;
    background: #fff;
    border: 2px solid #2e2e2e;
    border-radius: 14px;
}

.pin-dot {
    width: 12px;
    height: 12px;
    border: 2px solid #6b7d4a;
    border-radius: 50%;
    background: transparent;
    transition: background 0.12s ease, transform 0.12s ease;
}

.pin-dot.on {
    background: #6b7d4a;
    transform: scale(1.1);
}

.pin-keypad,
.pin-keypad.hidden {
    display: block !important;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255,255,255,.97);
    border: 1px solid rgba(79,91,47,.15);
}

.pin-keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 8px;
}

.pin-key {
    min-height: 44px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 800;
    font-size: 16px;
    color: #40502a;
    background: #eef5df;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease, filter 0.08s ease;
}

.pin-key:active {
    transform: translateY(1px);
    filter: brightness(0.97);
}

.pin-key-clear,
.pin-key-back {
    font-size: 12px;
    letter-spacing: 0.3px;
}

.pin-key-clear {
    background: #f4efe7;
    color: #6b6250;
}

.pin-key-back {
    background: #f7dede;
    color: #a83b3b;
}

#togglePinVisibility,
.pin-toggle-btn {
    display: none !important;
}

.dev-toggle {
    display: none !important;
}
