
  html, body { margin: 0; height: 100%; background: #000; overflow: hidden;
    touch-action: none; user-select: none; -webkit-user-select: none;
    -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
    font-family: 'Sarabun', system-ui, sans-serif; }
  canvas { display: block; }
  #credit { position: absolute; left: 10px; bottom: 10px; color: rgba(255,255,255,.85); background: rgba(0,0,0,.35);
    padding: 2px 8px; border-radius: 6px; font-size: 13px; z-index: 5; }
  #themes { position: absolute; left: 12px; top: 12px; z-index: 6; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: calc(100% - 80px); }
  #themes button { background: rgba(20,20,20,.75); border: 1px solid #444; border-radius: 8px; width: 38px; height: 34px;
    font-size: 17px; cursor: pointer; padding: 0; }
  #themes button.th.on { border-color: #ddd; background: rgba(60,60,60,.9); }
  #count { color: #fff; background: rgba(0,0,0,.4); border-radius: 8px; padding: 4px 10px; font-size: 14px; }
  #toggle { position: absolute; right: 12px; top: 12px; z-index: 6; background: rgba(20,20,20,.85); color: #ddd;
    border: 1px solid #333; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
  #panel { position: absolute; right: 12px; top: 52px; z-index: 7; width: 300px; max-height: calc(100% - 90px);
    overflow: auto; background: rgba(20,20,20,.95); color: #ccc; border: 1px solid #333; border-radius: 10px;
    padding: 12px 14px; font-size: 13.5px; line-height: 1.5; display: none; }
  #panel.open { display: block; }
  #panel h3 { margin: 14px 0 6px; font-size: 15px; color: #fff; }
  #panel h3:first-child { margin-top: 0; }
  #panel label { display: flex; justify-content: space-between; margin-top: 8px; }
  #panel label.chk { justify-content: flex-start; gap: 6px; margin-top: 4px; }
  #panel input[type=range] { width: 100%; }
  #panel input[type=number] { width: 52px; background: #222; color: #ddd; border: 1px solid #444; border-radius: 4px; padding: 2px 4px; font: inherit; }
  #panel ol { padding-left: 18px; margin: 6px 0; }
  #panel .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
  #panel button { background: #2a2a2a; color: #ddd; border: 1px solid #444; border-radius: 6px; padding: 4px 10px; font: inherit; cursor: pointer; }
  #panel button.danger { border-color: #7a3a3a; color: #f0b0b0; }
  #panel .note { color: #888; font-size: 12.5px; }
  #panel select { width: 100%; margin-top: 4px; background: #222; color: #ddd; border: 1px solid #444; border-radius: 6px; padding: 4px; font: inherit; }
  #stats { color: #888; font-size: 12px; margin-top: 8px; }
  #toast { position: absolute; left: 50%; top: calc(48px + env(safe-area-inset-top)); transform: translate(-50%, -16px); z-index: 30; opacity: 0;
    background: rgba(255,248,238,.97); color: #6b4a3a; padding: 8px 18px; border-radius: 20px; font-size: 15px; box-shadow: 0 4px 16px rgba(80,50,30,.25);
    transition: opacity .25s, transform .25s; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
  #toast.show { opacity: 1; transform: translate(-50%, 0); }
  #book, #photo { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.88); color: #ddd; }
  #book { overflow: auto; padding: 18px; box-sizing: border-box; }
  #book h2 { margin: 0 0 4px; font-size: 20px; color: #fff; }
  #book .sub { color: #999; font-size: 13.5px; margin-bottom: 14px; }
  #book .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-width: 760px; }
  #book .card { background: #1c1c22; border: 1px solid #333; border-radius: 12px; padding: 8px 6px; text-align: center; font-size: 13px; }
  #book .card.rare { border-color: #8a7a30; background: linear-gradient(160deg, #2a2618, #1c1c22); }
  #book .card canvas { width: 72px; height: 72px; display: block; margin: 0 auto; }
  #book .stars { color: #f5c842; font-size: 11px; height: 14px; }
  #book .cnt { color: #888; font-size: 12px; }
  #book button, #photo button { background: #2a2a2a; color: #eee; border: 1px solid #555; border-radius: 8px; padding: 6px 14px; font: inherit; cursor: pointer; }
  #photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; font-size: 14px; text-align: center; }
  #photo img { max-width: 92%; max-height: 72%; border-radius: 10px; box-shadow: 0 6px 30px rgba(0,0,0,.6); -webkit-touch-callout: default; user-select: auto; }
  #photo .row { display: flex; gap: 8px; }
  #dropHint { position: absolute; inset: 0; z-index: 30; display: none; align-items: center; justify-content: center;
    background: rgba(40,40,60,.7); color: #fff; font-size: 22px; border: 3px dashed #aab; pointer-events: none; }
  /* ===== เมนูผู้เล่น (โทนครีมพาสเทล) ===== */
  #themes { display: none !important; }                 /* แถบเก่า: ซ่อนไว้ ใช้เมนูล่างแทน */
  body:not(.dev) #toggle, body:not(.dev) #panel { display: none !important; }
  .ui, #dock, .sheet, #pill, #toast, #book { font-family: 'Mali', 'Sarabun', system-ui, sans-serif; }
  #pill { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 8;
    background: rgba(255,248,238,.92); color: #6b4a3a; border-radius: 18px; padding: 4px 14px; font-size: 14px;
    box-shadow: 0 3px 12px rgba(80,50,30,.18); white-space: nowrap; }
  #dock { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9;
    display: flex; gap: 2px; padding: 6px 8px; background: rgba(255,248,238,.96); border-radius: 26px;
    box-shadow: 0 6px 22px rgba(80,50,30,.28); }
  #dock button { width: 60px; height: 58px; border: 0; background: transparent; border-radius: 18px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0;
    font-family: inherit; color: #7a5a48; transition: transform .12s, background .15s; }
  #dock button .ic { font-size: 24px; line-height: 1; }
  #dock button .lb { font-size: 11px; }
  #dock button:hover { background: #ffeedd; }
  #dock button:active, .sheet button:active, .cardBtn:active { transform: scale(.9); }
  #dock button.on { background: #ffe3ec; }
  @keyframes boing { 0% { transform: scale(1) } 35% { transform: scale(1.18) } 70% { transform: scale(.94) } 100% { transform: scale(1) } }
  #dock button.boing .ic { display: inline-block; animation: boing .35s; }
  @media (max-width: 400px) { #dock { padding: 5px 4px; } #dock button { width: 52px; height: 54px; } #dock button .ic { font-size: 22px; } }

  #sheetBg { position: fixed; inset: 0; z-index: 20; background: rgba(40,25,15,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
  #sheetBg.show { opacity: 1; pointer-events: auto; }
  .sheet { position: fixed; left: 50%; bottom: 0; z-index: 21; width: min(520px, 100%); box-sizing: border-box;
    transform: translate(-50%, 105%); transition: transform .3s cubic-bezier(.2,.9,.3,1.15);
    background: #fff7ec; color: #6b4a3a; border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 30px rgba(60,35,20,.25); max-height: 80vh; overflow: auto; user-select: none; }
  .sheet.open { transform: translate(-50%, 0); }
  .sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: #e8d3bd; margin: 0 auto 10px; }
  .sheet h3 { margin: 0 0 12px; font-size: 19px; text-align: center; }
  .sheet .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cardBtn { border: 2px solid #f1dcc4; background: #fff; border-radius: 18px; padding: 12px 6px; cursor: pointer;
    font-family: inherit; color: #6b4a3a; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .12s; }
  .cardBtn .ic { font-size: 32px; }
  .cardBtn.on { border-color: #ff8fb1; background: #fff0f5; }
  .sheet .big { display: block; width: 100%; box-sizing: border-box; text-align: center; border: 0; border-radius: 18px; padding: 13px;
    background: #ff8fb1; color: #fff; font-family: inherit; font-size: 16px; cursor: pointer; transition: transform .12s; }
  .sheet .soft { border: 2px solid #f1dcc4; background: #fff; color: #6b4a3a; border-radius: 16px; padding: 9px 14px;
    font-family: inherit; font-size: 14px; cursor: pointer; transition: transform .12s; }
  .sheet .soft.danger { border-color: #f3b7b7; color: #c25555; }
  .sheet .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
  .sheet .lab { display: flex; justify-content: space-between; margin: 14px 2px 4px; font-size: 14px; }
  .sheet input[type=range] { width: 100%; accent-color: #ff8fb1; }
  .sheet .chk { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; }
  .sheet .chk input { accent-color: #ff8fb1; width: 18px; height: 18px; }
  .sheet .note { color: #a08672; font-size: 12.5px; text-align: center; margin-top: 8px; }
  .sheet ul { margin: 0; padding-left: 4px; list-style: none; line-height: 2; font-size: 15px; }
  .sheet.tall { max-height: 88vh; }
  .chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 10px; }
  .char { position: relative; background: #fff; border: 2px solid #f1dcc4; border-radius: 18px; padding: 8px 6px 6px;
    text-align: center; cursor: pointer; opacity: .55; transition: transform .12s, opacity .15s, border-color .15s; }
  .char.on { opacity: 1; border-color: #ff8fb1; background: #fff6f9; }
  .char:active { transform: scale(.94); }
  .char .th { width: 64px; height: 64px; display: block; margin: 0 auto; }
  .char .tick { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #e8d3bd;
    background: #fff; color: #fff; font-size: 13px; line-height: 19px; }
  .char.on .tick { background: #ff8fb1; border-color: #ff8fb1; }
  .char .del { position: absolute; right: 4px; top: 4px; border: 0; background: transparent; cursor: pointer; font-size: 15px; padding: 2px 4px; border-radius: 10px; font-family: inherit; color: #c25555; }
  .char .del.armed { background: #ffe1e1; font-size: 12px; }
  .char .nm { width: 100%; box-sizing: border-box; border: 0; background: transparent; text-align: center; font-family: inherit;
    font-size: 13px; color: #6b4a3a; margin-top: 4px; padding: 2px; border-radius: 8px; }
  .char input.nm:focus { outline: 2px solid #ffd0de; background: #fff; }
  .char .in { font-size: 11px; color: #a08672; }
  .char.add { opacity: 1; border-style: dashed; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 112px; }
  .char.add .plus { font-size: 30px; color: #ff8fb1; line-height: 1; }
  .char .cutb { position: absolute; right: 30px; top: 4px; border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 10px; }
  #cut { position: fixed; inset: 0; z-index: 50; background: rgba(40,25,15,.5); display: flex; align-items: center; justify-content: center; padding: 10px; box-sizing: border-box; }
  #cut .cutBox { background: #fff7ec; color: #6b4a3a; border-radius: 24px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); width: min(560px, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; }
  #cut h3 { margin: 0 0 10px; text-align: center; font-size: 18px; }
  #cut .tools { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
  #cut .soft { border: 2px solid #f1dcc4; background: #fff; color: #6b4a3a; border-radius: 14px; padding: 7px 12px; font-family: inherit; font-size: 14px; cursor: pointer; }
  #cut .soft.on { border-color: #ff8fb1; background: #fff0f5; }
  #cut .big { border: 0; border-radius: 16px; padding: 10px 22px; background: #ff8fb1; color: #fff; font-family: inherit; font-size: 15px; cursor: pointer; }
  #cut .stage { margin: 10px auto 4px; display: flex; justify-content: center; border-radius: 14px; overflow: hidden;
    background: conic-gradient(#e9e2da 25%, #fff 0 50%, #e9e2da 0 75%, #fff 0) 0 0 / 18px 18px; }
  #cut .stage canvas { max-width: 100%; max-height: 46vh; touch-action: none; cursor: crosshair; display: block; }
  #cut .hint { text-align: center; font-size: 13px; color: #a08672; min-height: 18px; }
  #cut .lab { display: flex; justify-content: space-between; margin: 8px 2px 2px; font-size: 14px; }
  #cut input[type=range] { width: 100%; accent-color: #ff8fb1; }
  #cut .row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
  #cut .row.foot { margin-top: 14px; }
  .nameIn { width: 100%; box-sizing: border-box; border: 2px solid #f1dcc4; border-radius: 14px; padding: 9px 12px; font-family: inherit; font-size: 15px; color: #6b4a3a; background: #fff; user-select: text; }
  .nameIn:focus { outline: none; border-color: #ff8fb1; }
  #photo .modes button.on { background: #ff8fb1; border-color: #ff8fb1; color: #fff; }
  #photo .tilt { perspective: 900px; display: flex; justify-content: center; max-width: 92%; }
  #photo .tiltIn { position: relative; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s ease; transform-style: preserve-3d; }
  #photo .tiltIn.active { transition: transform .06s linear; }
  #photo img { -webkit-user-drag: none; }
  #photo .tilt img { display: block; max-width: 100%; max-height: 62vh; border-radius: 22px; }
  #photo .tilt .glare { position: absolute; inset: 0; border-radius: 22px; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.55), rgba(255,255,255,0) 45%); mix-blend-mode: soft-light; }
  #photo .tilt.on .tiltIn.active .glare { opacity: 1; }
  #photo .tilt.on { touch-action: none; }
  #photo .frames { display: flex; gap: 6px; overflow-x: auto; max-width: 96%; padding: 4px 2px; }
  #photo .frames button { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 8px; min-width: 58px;
    background: rgba(255,248,238,.95); color: #6b4a3a; border: 2px solid transparent; border-radius: 14px; }
  #photo .frames button span { font-size: 20px; line-height: 1.1; }
  #photo .frames button small { font-size: 11px; }
  #photo .frames button.on { border-color: #ff8fb1; background: #fff0f5; }
  #photo .frames button.lock { opacity: .55; }
  #photo button { font-family: 'Mali', 'Sarabun', sans-serif; }
  #book .card.has { cursor: pointer; }
  .sheet .credit { text-align: center; color: #a08672; font-size: 13px; margin-top: 14px; }

  /* สมุดสะสมโทนเดียวกัน */
  #book { background: rgba(40,25,15,.45) !important; display: flex; align-items: flex-start; justify-content: center; }
  #book .bk { background: #fff7ec; color: #6b4a3a; border-radius: 24px; padding: 18px; width: min(760px, 100%); box-sizing: border-box; margin: auto 0; }
  #book h2 { color: #6b4a3a !important; text-align: center; }
  #book .sub { color: #a08672 !important; text-align: center; }
  #book .grid { margin: 0 auto; }
  #book .card { background: #fff !important; border: 2px solid #f1dcc4 !important; color: #6b4a3a; border-radius: 16px !important; }
  #book .card.rare { border-color: #f5c842 !important; background: linear-gradient(160deg, #fff8dc, #fff) !important; }
  #book .cnt { color: #a08672 !important; }
  #book button { background: #ff8fb1 !important; color: #fff !important; border: 0 !important; border-radius: 16px !important; padding: 9px 22px !important; font-family: inherit !important; }
  @media (max-width: 520px) { #credit { font-size: 11px; } #count { font-size: 12px; padding: 3px 8px; } }

  /* ===== Fluff Farm ===== */
  #toast { white-space: normal; text-align: center; width: max-content; max-width: min(92vw, 520px); }
  #hud { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 8; display: flex; gap: 6px; align-items: center;
    font-family: 'Mali', 'Sarabun', sans-serif; color: #6b4a3a; font-size: 14px; white-space: nowrap; }
  #hud .chip { background: rgba(255,248,238,.94); border-radius: 16px; padding: 4px 11px; box-shadow: 0 3px 12px rgba(80,50,30,.18); display: flex; align-items: center; gap: 4px; }
  #hud .lv { position: relative; overflow: hidden; }
  #hud .lv .xp { position: absolute; left: 0; bottom: 0; height: 3px; background: #ffb35c; border-radius: 2px; }
  #dock button { position: relative; }
  #dock .badge { position: absolute; top: 2px; right: 6px; background: #ff5f8f; color: #fff; border-radius: 10px; font-size: 11px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 3px; }
  .shopRow { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #f1dcc4; border-radius: 18px; padding: 6px 10px; margin-bottom: 8px; }
  .shopRow canvas { width: 60px; height: 60px; flex: 0 0 auto; }
  .shopRow .info { flex: 1; display: flex; flex-direction: column; font-size: 15px; }
  .shopRow .info small { color: #a08672; font-size: 12px; }
  .shopRow .btns { display: flex; flex-direction: column; gap: 4px; }
  .shopRow .btns .soft { padding: 5px 10px; font-size: 13px; }
  .shopRow.lock { opacity: .6; }
  .qHead { font-weight: 600; margin: 8px 2px 6px; }
  .qRow { display: flex; gap: 10px; align-items: center; background: #fff; border: 2px solid #f1dcc4; border-radius: 16px; padding: 8px 10px; margin-bottom: 8px; font-size: 14.5px; }
  .qRow.got { opacity: .55; }
  .qRow .qt { flex: 1; }
  .qRow small { color: #a08672; font-size: 12px; }
  .qRow .big, .qRow .soft { width: auto; padding: 7px 12px; font-size: 13px; white-space: nowrap; }
  .bar { height: 7px; background: #f3e6d8; border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
  .bar i { display: block; height: 100%; background: #7ccf6b; border-radius: 4px; }
  #shPig .top { display: flex; gap: 10px; align-items: center; }
  #pgThumb canvas { width: 80px; height: 80px; }
  #pgHead { font-size: 19px; }
  #pgHead small { display: block; font-size: 12.5px; color: #a08672; }
  #pgHead .sx.m { color: #4a8fe0; } #pgHead .sx.f { color: #ff5f8f; }
  .sb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 5px 0; }
  .sb span { width: 74px; } .sb .bar { flex: 1; margin: 0; height: 9px; } .sb em { width: 28px; text-align: right; font-style: normal; color: #a08672; font-size: 12px; }
  #pgInfo { font-size: 13.5px; margin: 8px 0; line-height: 1.6; }
  .acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .acts .soft { padding: 7px 4px; font-size: 13px; }
  .lab2 { font-size: 13.5px; margin: 10px 0 6px; }
  #pgMates { display: flex; flex-wrap: wrap; gap: 6px; }
  #pgMates .lab2, #pgMates .note { width: 100%; }
  .mate { border: 2px solid #f1dcc4; background: #fff; border-radius: 14px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; cursor: pointer; font-family: inherit; color: #6b4a3a; }
  .mate canvas { width: 44px; height: 44px; } .mate small { font-size: 11px; }
  #pgNameRow { display: none; gap: 6px; margin-top: 8px; }
  #book .card canvas { width: 72px; height: 72px; display: block; margin: 0 auto; }
  #book .cnt { font-size: 11.5px; }
  #birth { position: fixed; inset: 0; z-index: 40; background: radial-gradient(circle at 50% 45%, rgba(255,230,240,.25), rgba(30,15,25,.72)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #fff; text-align: center; padding: 20px; overflow: hidden; }
  #birth .bTitle { font-size: 24px; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,.5); animation: bIn .4s ease-out; }
  #birth .bRow { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
  #birth .bCard { width: 128px; height: 168px; background: #fff7ec; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #6b4a3a; position: relative; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
  #birth .bCard canvas { width: 92px; height: 92px; }
  #birth .bCard .q { position: absolute; font-size: 38px; font-weight: 600; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
  #birth .bCard b { font-size: 16px; } #birth .bCard small { font-size: 12px; color: #a08672; }
  #birth .bCard .nw { position: absolute; top: -10px; right: -8px; background: #ff5f8f; color: #fff; font-size: 12px; border-radius: 10px; padding: 2px 8px; transform: rotate(8deg); }
  #birth .shake { animation: bShake .5s ease-in-out infinite; }
  #birth .pop { animation: bPop .5s cubic-bezier(.3,1.6,.5,1); }
  #birth .rare { box-shadow: 0 0 0 4px var(--glow), 0 0 40px 12px var(--glow); background: linear-gradient(160deg, #fffdf3, #fff1c9); }
  #birth button { border: 0; border-radius: 18px; padding: 11px 22px; font-family: inherit; font-size: 16px; cursor: pointer; background: #fff7ec; color: #6b4a3a; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
  #birth button.big { background: #ff8fb1; color: #fff; font-weight: 600; }
  #birth .bBtns { display: flex; gap: 10px; justify-content: center; }
  #birth .bTip { font-size: 13px; opacity: .85; min-height: 18px; }
  #birth .conf { position: fixed; font-style: normal; font-size: 22px; pointer-events: none; animation: bConf 1.4s ease-out forwards; }
  @keyframes bShake { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-6deg) scale(1.03) } 75% { transform: rotate(6deg) scale(1.03) } }
  @keyframes bPop { 0% { transform: scale(.4) rotateY(90deg); filter: brightness(3) } 100% { transform: scale(1) rotateY(0) } }
  @keyframes bIn { from { transform: translateY(-14px); opacity: 0 } }
  @keyframes bConf { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 1 } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 120px)) scale(1.1) rotate(220deg); opacity: 0 } }
  .tabs { display: flex; gap: 6px; margin-bottom: 10px; }
  .tabs button { flex: 1; border: 2px solid #f1dcc4; background: #fff; border-radius: 14px; padding: 7px 4px; font-family: inherit; font-size: 13.5px; color: #6b4a3a; cursor: pointer; }
  .tabs button.on { background: #ffe3ec; border-color: #ff9fbf; font-weight: 600; }
  .dIc { width: 60px; text-align: center; font-size: 36px; }
  .evCard { background: #fff; border: 2px solid #f1dcc4; border-radius: 18px; padding: 10px 12px; margin-bottom: 10px; }
  .evCard small { display: block; color: #a08672; font-size: 12.5px; margin: 2px 0 8px; }
  .evCard .evT { font-weight: 600; font-size: 16px; }
  #evPick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  #evPick .lab2, #evPick .note { width: 100%; }
  .nRow { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px dashed #f1dcc4; }
  .nRow .av { font-size: 34px; } .nRow .info { flex: 1; display: flex; flex-direction: column; font-size: 14.5px; } .nRow .info small { margin: 0; }
  .nRow .btns { display: flex; flex-direction: column; gap: 4px; } .nRow .btns .soft { padding: 5px 8px; font-size: 12px; }
  .nRow.lock { opacity: .55; }
  .evOv { position: fixed; inset: 0; z-index: 40; background: rgba(30,15,25,.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; text-align: center; padding: 16px; font-family: 'Mali', 'Sarabun', sans-serif; }
  .evOv .bTitle { font-size: 22px; font-weight: 600; } .evOv .bTip { font-size: 14px; min-height: 18px; }
  .evOv button { border: 0; border-radius: 18px; padding: 12px 26px; font-family: inherit; font-size: 17px; cursor: pointer; background: #ff8fb1; color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.3); touch-action: manipulation; user-select: none; }
  .evOv.race #rcTap { padding: 16px 40px; font-size: 20px; }
  .evOv canvas#rcCv { border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.4); touch-action: manipulation; }
  .ctList { display: flex; flex-direction: column; gap: 8px; width: min(440px, 100%); }
  .ctRow { display: flex; align-items: center; gap: 10px; background: #fff7ec; color: #6b4a3a; border-radius: 16px; padding: 6px 12px; text-align: left; }
  .ctRow.me { box-shadow: 0 0 0 3px #ff8fb1; }
  .ctRow canvas { width: 48px; height: 48px; } .ctRow .info { flex: 1; display: flex; flex-direction: column; } .ctRow small { color: #a08672; font-size: 12px; }
  .ctRow .bar i { transition: width .8s ease-out; width: 0; background: #ffb35c; }
  .ctRow .sc { font-weight: 600; width: 42px; text-align: right; } .ctRow .md { font-size: 24px; width: 30px; }
  .evOv .ghost { background: rgba(255,255,255,.18); }
  .evOv.wd, .evOv.fam { justify-content: safe center; overflow-y: auto; gap: 10px; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  @media (max-width: 520px) { .evOv .bTitle { font-size: 18px; } .evOv button { padding: 10px 16px; font-size: 15px; } .wdList { max-height: 34vh; } .evOv .wdItem .ic { font-size: 24px; } }
  body:has(.evOv) #dock, body:has(#birth) #dock { visibility: hidden; }
  .fTree .note { color: #fff; opacity: .85; font-size: 13px; }
  @media (max-width: 520px) { .fNode { width: 76px; padding: 3px 4px; font-size: 12px; } .fNode canvas, .fNode .th { width: 42px; height: 42px; line-height: 42px; } }
  .hRow { display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid #f1dcc4; border-radius: 16px; padding: 8px 10px; margin-bottom: 8px; }
  .hRow.on { border-color: #9be3c6; background: #f3fff9; } .hRow.lock { opacity: .55; }
  .hRow .av { font-size: 32px; } .hRow .info { flex: 1; display: flex; flex-direction: column; font-size: 14.5px; }
  .hRow .info small { color: #a08672; font-size: 12px; } .hRow .info b small { font-weight: 400; } .hRow .left { color: #2f9a6a !important; }
  .hRow .btns { display: flex; flex-direction: column; gap: 4px; } .hRow .soft { padding: 5px 8px; font-size: 12px; white-space: nowrap; }
  .hRules { margin: -4px 0 10px 46px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; } .hRules small { color: #a08672; font-size: 11.5px; }
  .keepMin { display: flex; align-items: center; gap: 6px; margin: 2px 0; } .keepMin .soft { padding: 1px 10px; font-size: 15px; } .keepMin b { min-width: 22px; text-align: center; }
  .hRep { background: #fff7ec; color: #6b4a3a; border-radius: 18px; padding: 12px 18px; width: min(340px, 90vw); text-align: left; }
  .hRep div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14.5px; } .hRep hr { border: 0; border-top: 1px dashed #e8d3bd; margin: 6px 0; }
  .hRep .net { font-weight: 600; font-size: 16px; }
  #shopTabs button { font-size: 12.5px; padding: 7px 2px; }
  .wdTop { display: flex; gap: 14px; align-items: flex-start; justify-content: center; flex-wrap: wrap; max-width: 760px; }
  .wdPrev { background: radial-gradient(circle at 50% 40%, #fff7ec, #f3dcc4); border-radius: 22px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
  .wdViews { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
  .wdViews button, .wdTabs button { padding: 6px 10px; font-size: 13px; background: #fff; color: #6b4a3a; box-shadow: none; border-radius: 12px; font-weight: 400; }
  .wdViews button.on, .wdTabs button.on { background: #ff8fb1; color: #fff; font-weight: 600; }
  .wdSide { width: min(420px, 92vw); }
  .wdTabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; justify-content: center; }
  .wdList { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 42vh; overflow: auto; }
  .evOv .wdItem { background: #fff7ec; color: #6b4a3a; border-radius: 16px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: none; border: 2px solid transparent; font-weight: 400; font-size: 13px; }
  .evOv .wdItem .ic { font-size: 30px; } .evOv .wdItem small { color: #a08672; font-size: 11.5px; }
  .evOv .wdItem.on { border-color: #ff8fb1; background: #fff0f5; } .evOv .wdItem.lock { opacity: .6; }
  .fTree { display: flex; flex-direction: column; gap: 10px; max-height: 66vh; overflow: auto; width: min(760px, 100%); }
  .fRow { background: rgba(255,255,255,.1); border-radius: 16px; padding: 6px 8px; }
  .fLab { font-size: 12.5px; opacity: .85; text-align: left; margin-bottom: 4px; }
  .fNodes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .fNode { background: #fff7ec; color: #6b4a3a; border-radius: 14px; padding: 4px 8px; width: 96px; display: flex; flex-direction: column; align-items: center; font-size: 13px; }
  .fNode canvas { width: 52px; height: 52px; } .fNode small { font-size: 10.5px; color: #a08672; text-align: center; }
  .fNode .th { width: 52px; height: 52px; line-height: 52px; font-size: 26px; color: #c9b5a3; }
  .fNode.me { box-shadow: 0 0 0 3px #ff8fb1; } .fNode.tap { cursor: pointer; } .fNode.gone { opacity: .65; } .fNode.unk { opacity: .5; }
.appBox { margin-top: 14px; background: #fff; border: 2px solid #f1dcc4; border-radius: 18px; padding: 12px; text-align: center; }
.appBox .appT { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.appBadges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.soonBtn { border: 2px dashed #e8d3bd; background: #fffaf4; color: #8c6e5c; border-radius: 14px; padding: 7px 12px; font-family: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.soonBtn em { font-style: normal; background: #ffe3ec; color: #d9527e; font-size: 11px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
