/* KINGDOM B: chooser, login welcome card, My Card tab. Same layer as the site's override rules. */
@layer club-desktop-standard {
  html:root body main.member-tools .member-nav:not(#x):not(#y):not(#z):not(#k) a:not(#x) { white-space:nowrap !important; }
  @media (max-width:760px) {
    html:root body main.member-tools .member-nav:not(#x):not(#y):not(#z):not(#k) { display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)) !important; justify-items:center !important; gap:6px 4px !important; width:100% !important; }
  }

  html:root body .kb-choose:not(#x):not(#y):not(#z) { margin:6px 0 18px !important; text-align:center !important; color:#172b3d !important; }
  html:root body .kb-choose-title:not(#x):not(#y):not(#z) { font-size:18px !important; font-weight:700 !important; line-height:1.4 !important; }
  html:root body .kb-choose-note:not(#x):not(#y):not(#z) { margin-top:4px !important; font-size:13px !important; line-height:1.5 !important; color:#5b6773 !important; }
  html:root body .kb-choices:not(#x):not(#y):not(#z) { display:flex !important; justify-content:center !important; gap:22px !important; margin-top:14px !important; }
  html:root body .kb-choice:not(#x):not(#y):not(#z) { display:flex !important; flex-direction:column !important; align-items:center !important; gap:6px !important; width:auto !important; min-width:0 !important; min-height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important; box-shadow:none !important; cursor:pointer !important; }
  html:root body .kb-ring:not(#x):not(#y):not(#z) { position:relative !important; box-sizing:border-box !important; width:118px !important; height:118px !important; padding:3px !important; border:2px solid #dce2e1 !important; border-radius:50% !important; background:#fff !important; }
  html:root body .kb-ring .kb-face:not(#x):not(#y):not(#z) { display:block !important; width:100% !important; height:100% !important; border-radius:50% !important; }
  html:root body .kb-choice[aria-checked="true"] .kb-ring:not(#x):not(#y):not(#z) { padding:2px !important; border:3px solid #172b3d !important; }
  html:root body .kb-choice[aria-checked="true"] .kb-ring:not(#x):not(#y):not(#z)::after { content:"✓"; position:absolute; right:2px; bottom:2px; display:flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%; background:#172b3d; color:#fff; font-size:16px; font-weight:700; }
  html:root body .kb-letter:not(#x):not(#y):not(#z) { font-size:15px !important; font-weight:700 !important; line-height:1.2 !important; color:#172b3d !important; }

  html:root body .kb-thanks:not(#x):not(#y):not(#z) { display:flex !important; flex-direction:column !important; align-items:center !important; gap:10px !important; margin:4px 0 18px !important; text-align:center !important; color:#172b3d !important; }
  html:root body .kb-thanks-title:not(#x):not(#y):not(#z) { font-size:18px !important; font-weight:700 !important; }
  html:root body .kb-thanks-rank:not(#x):not(#y):not(#z) { font-size:16px !important; font-weight:700 !important; }

  html:root body .kb-layer:not(#x):not(#y):not(#z) { position:fixed !important; inset:0 !important; z-index:2147483000 !important; display:flex !important; align-items:center !important; justify-content:center !important; margin:0 !important; padding:16px !important; box-sizing:border-box !important; background:rgba(255,255,255,.66) !important; -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); overflow:auto !important; }
  html:root body .kb-welcome:not(#x):not(#y):not(#z) { overflow:hidden !important; }
  html:root body .kb-welcome .kb-holder:not(#x):not(#y):not(#z) { position:relative !important; width:min(330px,74vw,calc((100vh - 150px) * .5625)) !important; width:min(330px,74vw,calc((100dvh - 150px) * .5625)) !important; margin:30px 0 0 !important; }
  html:root body .kb-x:not(#x):not(#y):not(#z) { position:absolute !important; top:-48px !important; right:-10px !important; left:auto !important; display:flex !important; align-items:center !important; justify-content:center !important; width:44px !important; height:44px !important; min-width:0 !important; min-height:0 !important; margin:0 !important; padding:0 !important; border:0 !important; background:transparent !important; box-shadow:none !important; cursor:pointer !important; }
  html:root body .kb-x svg:not(#x):not(#y):not(#z) { display:block !important; width:36px !important; height:36px !important; }
  html:root body .kb-panel:not(#x):not(#y):not(#z) { box-sizing:border-box !important; width:min(360px,100%) !important; margin:auto !important; padding:24px 16px 20px !important; border:1px solid #dce2e1 !important; background:#fff !important; box-shadow:0 12px 36px rgba(23,43,61,.16) !important; text-align:center !important; }
  html:root body .kb-start:not(#x):not(#y):not(#z) { display:block !important; width:100% !important; min-height:48px !important; margin:0 !important; padding:10px !important; border:1px solid #172b3d !important; border-radius:0 !important; background:#172b3d !important; color:#fff !important; font-size:16px !important; font-weight:700 !important; cursor:pointer !important; }
  html:root body .kb-start:disabled:not(#x):not(#y):not(#z) { opacity:.35 !important; cursor:default !important; }

  html:root body .kb-stage:not(#x):not(#y):not(#z) { position:relative !important; width:100% !important; aspect-ratio:9/16 !important; margin:0 !important; perspective:1100px; }
  .kb-card { position:absolute; inset:0; transform-style:preserve-3d; -webkit-transform-style:preserve-3d; }
  .kb-front, .kb-back { position:absolute; inset:0; overflow:hidden; -webkit-backface-visibility:hidden; backface-visibility:hidden; box-shadow:0 10px 26px rgba(23,43,61,.28); }
  .kb-front { transform:rotateY(0deg); }
  html:root body .kb-front canvas:not(#x):not(#y):not(#z) { display:block !important; width:100% !important; height:100% !important; max-width:none !important; margin:0 !important; }
  html:root body .kb-back:not(#x):not(#y):not(#z) { transform:rotateY(180deg); display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important; gap:6px !important; background:radial-gradient(#4a2486,#150d30 72%) !important; }
  .kb-back::before { content:""; position:absolute; inset:10px; border:2px solid #e7c06a; }
  html:root body .kb-crown:not(#x):not(#y):not(#z) { font-family:"Noto Serif KR",Georgia,serif !important; font-size:40px !important; line-height:1.1 !important; color:#f0d58c !important; }
  html:root body .kb-word:not(#x):not(#y):not(#z) { font-family:"Noto Serif KR",Georgia,serif !important; font-size:28px !important; font-weight:700 !important; line-height:1.2 !important; white-space:nowrap !important; color:#f0d58c !important; }
  .kb-shine { position:absolute; top:-20%; bottom:-20%; left:-35%; width:24%; transform:skewX(-18deg); background:linear-gradient(90deg,transparent,rgba(255,250,225,.85),transparent); pointer-events:none; }
  html:root body .kb-spark:not(#x):not(#y):not(#z) { position:absolute !important; width:0 !important; height:0 !important; display:flex !important; align-items:center !important; justify-content:center !important; overflow:visible !important; font-size:var(--kb-size) !important; line-height:1 !important; color:#e0ac35 !important; text-shadow:0 0 8px #ffe9a8; opacity:0; pointer-events:none; z-index:2; }
  .kb-go .kb-card { animation:kb-spin 1.3s cubic-bezier(.45,.05,.25,1) .1s both; }
  .kb-go .kb-shine { animation:kb-shine .75s ease-in-out 1.3s both; }
  .kb-go .kb-spark { animation-name:kb-twinkle; animation-duration:.7s; animation-timing-function:ease-in-out; animation-fill-mode:both; }
  @keyframes kb-spin { 0% { transform:rotateY(0deg) scale(.92); } 50% { transform:rotateY(180deg) scale(1); } 100% { transform:rotateY(360deg) scale(1); } }
  @keyframes kb-shine { from { left:-35%; } to { left:125%; } }
  @keyframes kb-twinkle { 0% { opacity:0; transform:scale(.3); } 50% { opacity:1; transform:scale(1.15); } 100% { opacity:0; transform:scale(.5); } }
  @media (prefers-reduced-motion:reduce) {
    .kb-go .kb-card, .kb-go .kb-shine, .kb-go .kb-spark { animation:none !important; }
  }

  html:root body main.member-tools .kb-mycard:not(#x):not(#y) { display:flex !important; flex-direction:column !important; align-items:center !important; gap:16px !important; padding:8px 0 4px !important; }
  html:root body main.member-tools .kb-mycard .kb-holder:not(#x):not(#y) { width:min(320px,78vw) !important; }
  html:root body main.member-tools .kb-actions:not(#x):not(#y) { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:6px !important; width:min(380px,100%) !important; }
  html:root body main.member-tools .kb-action:not(#x):not(#y) { display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important; gap:6px !important; width:100% !important; min-width:0 !important; min-height:68px !important; margin:0 !important; padding:8px 2px !important; border:1px solid #172b3d !important; border-radius:0 !important; background:#fff !important; color:#172b3d !important; cursor:pointer !important; }
  html:root body main.member-tools .kb-action:disabled:not(#x):not(#y) { opacity:.4 !important; }
  html:root body main.member-tools .kb-action span:not(#x):not(#y) { font-size:12px !important; font-weight:700 !important; line-height:1.2 !important; white-space:nowrap !important; color:#172b3d !important; }
  html:root body main.member-tools .kb-action svg:not(#x):not(#y) { display:block !important; width:26px !important; height:26px !important; }
  html:root body main.member-tools .kb-note:not(#x):not(#y) { max-width:340px !important; font-size:13px !important; line-height:1.5 !important; text-align:center !important; color:#5b6773 !important; }
  html:root body main.member-tools .kb-note:empty:not(#x):not(#y) { display:none !important; }

  /* Treasure sizes step up: coin smallest, medal bigger, gold bar biggest */
  html:root body main.member-tools .mystar .ms-treasure:not(#x):not(#y):not(#z) { --ms-size:clamp(38px,12vw,52px); --ms-coin:clamp(15px,4.4vw,19px); }
  html:root body main.member-tools .mystar .ms-bars img:not(#x):not(#y):not(#z) { width:calc(var(--ms-size) * 2.6) !important; }
  @media (min-width:761px) {
    html:root body main.member-tools .mystar .ms-treasure:not(#x):not(#y):not(#z) { --ms-size:82px; --ms-coin:30px; }
  }
}

/* Diary: heart jewel for HOTCLUB, slightly smaller jewels with a gap. Treasure: bronze coin for single classes. */
@layer club-desktop-standard {
  html:root body main.member-tools .mydiary .md-gems:not(#x):not(#y):not(#z) { gap:2px 3px !important; align-items:center !important; }
  html:root body main.member-tools .mydiary img.md-gem:not(#x):not(#y):not(#z) { width:14px !important; max-width:calc(50% - 2px) !important; }
  html:root body main.member-tools .mydiary img.md-gem-hot:not(#x):not(#y):not(#z) { width:15px !important; aspect-ratio:42/40 !important; }
  html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z) { display:flex !important; flex-wrap:wrap !important; justify-content:center !important; gap:3px 2px !important; width:100% !important; max-width:82px !important; margin:0 auto !important; }
  html:root body main.member-tools .mystar .ms-ones img:not(#x):not(#y):not(#z) { flex:0 0 auto !important; width:14px !important; height:14px !important; }
  @media (max-width:360px) {
    html:root body main.member-tools .mystar .ms-ones img:not(#x):not(#y):not(#z) { width:12px !important; height:12px !important; }
  }
  @media (min-width:761px) {
    html:root body main.member-tools .mydiary img.md-gem:not(#x):not(#y):not(#z) { width:22px !important; }
    html:root body main.member-tools .mydiary img.md-gem-hot:not(#x):not(#y):not(#z) { width:23px !important; }
    html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z) { max-width:none !important; gap:8px !important; }
    html:root body main.member-tools .mystar .ms-ones img:not(#x):not(#y):not(#z) { width:24px !important; height:24px !important; }
  }
}

/* Treasure Island: wide on PC (ten to a line), filled from the left on PC and phone. */
@layer club-desktop-standard {
  html:root body main.member-tools .mystar .ms-treasure:not(#x):not(#y):not(#z):not(#k) { align-items:flex-start !important; padding-left:10px !important; }
  html:root body main.member-tools .mystar .ms-bars:not(#x):not(#y):not(#z):not(#k) { justify-content:flex-start !important; }
  html:root body main.member-tools .mystar .ms-medals:not(#x):not(#y):not(#z):not(#k) { justify-content:start !important; margin:0 !important; }
  html:root body main.member-tools .mystar .ms-coins:not(#x):not(#y):not(#z):not(#k) { justify-content:flex-start !important; margin:0 !important; }
  html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z):not(#k) { justify-content:flex-start !important; margin:0 !important; }
  html:root body main.member-tools .mystar span.ms-empty:not(#x):not(#y):not(#z):not(#k) { text-align:left !important; }
  @media (max-width:360px) {
    html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z):not(#k) { max-width:70px !important; }
  }
  @media (min-width:761px) {
    html:root body main.member-tools .mystar:not(#x):not(#y):not(#z):not(#k) { width:100% !important; max-width:880px !important; box-sizing:border-box !important; }
    html:root body main.member-tools .mystar .ms-main:not(#x):not(#y):not(#z):not(#k) { grid-template-columns:150px minmax(0,1fr) !important; }
    html:root body main.member-tools .mystar .ms-treasure:not(#x):not(#y):not(#z):not(#k) { padding-left:20px !important; }
    html:root body main.member-tools .mystar .ms-medals:not(#x):not(#y):not(#z):not(#k) { grid-template-columns:repeat(10,minmax(0,62px)) !important; gap:10px 6px !important; width:100% !important; max-width:none !important; }
    html:root body main.member-tools .mystar .ms-coins:not(#x):not(#y):not(#z):not(#k), html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z):not(#k) { width:100% !important; max-width:none !important; gap:8px !important; }
  }
}

/* 1000-class crown size, two-line card back, two small share/download buttons */
@layer club-desktop-standard {
  html:root body main.member-tools .mystar .ms-bars:not(#x):not(#y):not(#z):not(#k):not(#c) { gap:4px !important; }
  html:root body main.member-tools .mystar .ms-bars img:not(#x):not(#y):not(#z):not(#k):not(#c) { width:50px !important; aspect-ratio:120/108 !important; }
  @media (max-width:360px) {
    html:root body main.member-tools .mystar .ms-bars img:not(#x):not(#y):not(#z):not(#k):not(#c) { width:40px !important; }
  }
  @media (min-width:761px) {
    html:root body main.member-tools .mystar .ms-bars img:not(#x):not(#y):not(#z):not(#k):not(#c) { width:80px !important; }
  }

  html:root body .kb-x:not(#x):not(#y):not(#z):not(#k):focus { outline:none !important; box-shadow:none !important; }

  html:root body .kb-back .kb-word:not(#x):not(#y):not(#z):not(#k) { font-size:22px !important; letter-spacing:.3em !important; margin-right:-.3em !important; }
  html:root body .kb-back .kb-club:not(#x):not(#y):not(#z):not(#k) { font-family:"Noto Serif KR",Georgia,serif !important; font-size:46px !important; font-weight:700 !important; line-height:1.2 !important; white-space:nowrap !important; color:#ffe9a8 !important; text-shadow:0 0 18px rgba(255,214,110,.85) !important; }

  html:root body main.member-tools .kb-actions:not(#x):not(#y):not(#z) { display:flex !important; justify-content:center !important; gap:8px !important; width:100% !important; }
  html:root body main.member-tools .kb-actions .kb-action:not(#x):not(#y):not(#z) { flex:0 0 auto !important; flex-direction:row !important; gap:6px !important; width:auto !important; min-height:36px !important; height:36px !important; padding:0 16px !important; border:1px solid #c5cacf !important; border-radius:0 !important; background:#fff !important; box-shadow:none !important; }
  html:root body main.member-tools .kb-actions .kb-action svg:not(#x):not(#y):not(#z) { width:16px !important; height:16px !important; }
}

/* the card inside the treasure chest: above the treasures on a phone, beside them on a wide screen */
@layer club-desktop-standard {
  html:root body main.member-tools #mystar .kb-slot:empty:not(#x):not(#y):not(#z) { display:none !important; }
  html:root body main.member-tools #mystar .kb-slot .kb-mycard:not(#x):not(#y):not(#z) { margin:0 0 20px !important; }
  @media (min-width:1000px) {
    html:root body main.member-tools #mystar:not([hidden]):has(.kb-mycard):not(#x):not(#y):not(#z) { display:grid !important; grid-template-columns:276px minmax(0,1fr) !important; gap:18px !important; align-items:start !important; }
    html:root body main.member-tools #mystar .kb-slot .kb-mycard:not(#x):not(#y):not(#z) { margin:0 !important; padding-top:0 !important; }
    html:root body main.member-tools #mystar .kb-slot .kb-holder:not(#x):not(#y):not(#z) { width:100% !important; }
    html:root body main.member-tools #mystar:has(.kb-mycard) .mystar .ms-main:not(#x):not(#y):not(#z):not(#k) { grid-template-columns:134px minmax(0,1fr) !important; }
    html:root body main.member-tools #mystar:has(.kb-mycard) .mystar .ms-treasure:not(#x):not(#y):not(#z):not(#k) { padding-left:12px !important; }
    html:root body main.member-tools #mystar:has(.kb-mycard) .mystar .ms-coins:not(#x):not(#y):not(#z):not(#k):not(#c),
    html:root body main.member-tools #mystar:has(.kb-mycard) .mystar .ms-ones:not(#x):not(#y):not(#z):not(#k):not(#c) { gap:5px !important; }
    html:root body main.member-tools #mystar:has(.kb-mycard) .mystar .ms-medals:not(#x):not(#y):not(#z):not(#k):not(#c) { gap:8px 3px !important; }
  }
}

/* the separate card tab is for phones only; wider screens show the card inside the treasure chest */
@layer club-desktop-standard {
  @media (min-width:761px) {
    html:root body main.member-tools .member-nav:not(#x):not(#y):not(#z):not(#k):not(#c) a[href="#kingdom"] { display:none !important; }
    html:root body main.member-tools .kb-slot .kb-phone-only:not(#x):not(#y):not(#z) { display:none !important; }
  }
}
/* phones: the whole card and its buttons fit on one screen */
@layer club-desktop-standard {
  @media (max-width:760px) {
    html:root body main.member-tools .kb-slot .kb-mycard .kb-holder:not(#x):not(#y):not(#z):not(#k) { width:min(320px,78vw,calc((100vh - 190px) * .5625)) !important; width:min(320px,78vw,calc((100svh - 190px) * .5625)) !important; }
    html:root body main.member-tools #kingdom:not([hidden]):has(.kb-mycard):not(#x):not(#y):not(#z) { min-height:100vh !important; }
  }
}

/* welcome card: only the card shows, the layer around it is transparent */
.kb-layer.kb-welcome:not(#x):not(#y):not(#z):not(#w) { background:transparent !important; -webkit-backdrop-filter:none !important; backdrop-filter:none !important; }

/* v10 (2026-11-29): card 110%, treasure sizes small < middle < large, director jewel */
@layer club-desktop-standard {
  html:root body .kb-welcome .kb-holder:not(#x):not(#y):not(#z):not(#k):not(#q) { width:min(363px,81vw,calc((100vh - 150px) * .619)) !important; width:min(363px,81vw,calc((100dvh - 150px) * .619)) !important; }
  html:root body main.member-tools .kb-mycard .kb-holder:not(#x):not(#y):not(#z):not(#k):not(#q) { width:min(352px,86vw) !important; }
  @media (max-width:760px) {
    html:root body main.member-tools .kb-slot .kb-mycard .kb-holder:not(#x):not(#y):not(#z):not(#k):not(#q) { width:min(352px,86vw,calc((100vh - 190px) * .619)) !important; width:min(352px,86vw,calc((100svh - 190px) * .619)) !important; }
  }
  @media (min-width:761px) {
    html:root body main.member-tools #mystar:not([hidden]):has(.kb-mycard):not(#x):not(#y):not(#z):not(#k):not(#q) { grid-template-columns:304px minmax(0,1fr) !important; }
    html:root body main.member-tools #mystar .kb-slot .kb-holder:not(#x):not(#y):not(#z):not(#k):not(#q) { width:100% !important; }
  }
  html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z):not(#k):not(#q) { max-width:calc(5 * var(--ms-one, 18px) + 12px) !important; gap:3px !important; }
  html:root body main.member-tools .mystar .ms-ones img:not(#x):not(#y):not(#z):not(#k):not(#q) { width:var(--ms-one, 18px) !important; height:var(--ms-one, 18px) !important; }
  html:root body main.member-tools .mystar .ms-dir:not(#x):not(#y) { background:#f8f2e2 !important; --ms-ink:#5a4410; }
  html:root body main.member-tools .mydiary img.md-gem-dir:not(#x):not(#y):not(#z) { width:13px !important; aspect-ratio:36/42 !important; }
  @media (min-width:761px) {
    html:root body main.member-tools .mydiary img.md-gem-dir:not(#x):not(#y):not(#z) { width:20px !important; }
    html:root body main.member-tools .mystar .ms-ones:not(#x):not(#y):not(#z):not(#k):not(#q) { max-width:none !important; gap:6px !important; }
  }
}
html:root body main.member-tools .mystar .ms-treasure:not(#x):not(#y):not(#z):not(#k) { --ms-size:clamp(30px,9vw,42px); --ms-coin:clamp(20px,6vw,27px); --ms-one:clamp(16px,5vw,21px); }
@media (min-width:761px) {
  html:root body main.member-tools .mystar .ms-treasure:not(#x):not(#y):not(#z):not(#k) { --ms-size:70px; --ms-coin:50px; --ms-one:40px; }
}
@layer club-desktop-standard {
  html:root body main.member-tools .mydiary .md-key img:not(#x):not(#y):not(#z) { width:17px !important; height:17px !important; object-fit:contain !important; }
}
@layer club-desktop-standard {
  /* wide screens: ten 1-class coins fill one line of the chest; 10-class coins 1.2x and medals 1.5x of that */
  @media (min-width:761px) {
    html:root body main.member-tools .mystar :is(.ms-treasure, .ms-medals, .ms-coins, .ms-ones):not(#x):not(#y):not(#z):not(#k):not(#c):not(#q) { box-sizing:border-box !important; width:100% !important; max-width:100% !important; min-width:0 !important; }
    html:root body main.member-tools .mystar .ms-medals:not(#x):not(#y):not(#z):not(#k):not(#c):not(#q) { display:grid !important; grid-template-columns:repeat(5, calc((100% - 45px) * .15)) !important; justify-content:start !important; gap:5px !important; }
    html:root body main.member-tools .mystar .ms-medals img:not(#x):not(#y):not(#z):not(#k):not(#c):not(#q) { width:100% !important; height:auto !important; }
    html:root body main.member-tools .mystar :is(.ms-coins, .ms-ones):not(#x):not(#y):not(#z):not(#k):not(#c):not(#q) { display:flex !important; flex-wrap:wrap !important; justify-content:flex-start !important; gap:5px !important; }
    html:root body main.member-tools .mystar .ms-coins img:not(#x):not(#y):not(#z):not(#k):not(#c):not(#q) { flex:0 0 auto !important; width:calc((100% - 45px) * .12) !important; height:auto !important; aspect-ratio:1 !important; }
    html:root body main.member-tools .mystar .ms-ones img:not(#x):not(#y):not(#z):not(#k):not(#c):not(#q) { flex:0 0 auto !important; width:calc((100% - 45px) / 10) !important; height:auto !important; aspect-ratio:1 !important; }
  }
}
