/* Avatar Phnom Penh - players' website (register, my account). Colours from the start picture:
   night sky purple, sunset orange, the gold "AVATAR PHNOM PENH" title with its dark red edge, the game's pink. */
:root {
  --sky1: #160d2e; --sky2: #2b1652; --sky3: #4a1f5e;
  --card: rgba(255, 255, 255, .07); --card-b: rgba(255, 255, 255, .13);
  --text: #f7f1ff; --muted: #b9add6; --gold1: #ffe27a; --gold2: #ffb21f; --gold-edge: #7b2410;
  --pink: #ff5fa8; --green: #4cd18a; --red: #ff6b6b; --field: rgba(10, 6, 24, .55);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-height: 100%; background: var(--sky3); }
body {
  margin: 0; min-height: 100vh; color: var(--text); line-height: 1.55;
  font-family: "Kantumruy Pro", "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 16px;
  background: radial-gradient(1200px 600px at 80% -10%, #6b2a6e 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #3b2380 0%, transparent 55%),
              linear-gradient(180deg, var(--sky1), var(--sky2) 55%, var(--sky3));
  background-repeat: no-repeat; background-color: var(--sky3);
}
body::before {                                   /* little pixel stars */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .55; z-index: 0;
  background-image: radial-gradient(1.5px 1.5px at 10% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 8%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 15%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 75% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 12%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 20% 55%, #fff 50%, transparent 51%);
}
a { color: var(--gold1); }
.wrap { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }

/* one language at a time (html[data-lang], switch in the header) */
html[data-lang="km"] .l-en, html[data-lang="en"] .l-km { display: none !important; }
html[data-lang="en"] body { font-family: "Segoe UI", system-ui, -apple-system, "Kantumruy Pro", sans-serif; }

/* language switch with flags */
.lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(0, 0, 0, .28);
  border: 1px solid var(--card-b); margin-left: auto; }
.lang button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px;
  background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; box-shadow: none; }
.lang button:hover { color: var(--text); }
html[data-lang="km"] .lang [data-set-lang="km"], html[data-lang="en"] .lang [data-set-lang="en"] {
  background: rgba(255, 255, 255, .14); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.flag { width: 24px; height: 16px; border-radius: 3px; flex: 0 0 auto; display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 1px 3px rgba(0, 0, 0, .4); }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 40px; height: 40px; border-radius: 10px; image-rendering: pixelated; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.brand b { font-family: "Lilita One", "Kantumruy Pro", sans-serif; font-weight: 400; font-size: 22px; letter-spacing: .5px;
  background: linear-gradient(180deg, var(--gold1), var(--gold2)); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-stroke: .6px var(--gold-edge); }
.brand small { display: block; font-size: 12px; color: var(--muted); margin-top: -4px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 561px) { .lang { order: 3; margin-left: 4px; } .nav { margin-left: auto; } }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.nav a:hover, .nav a.on { background: rgba(255, 255, 255, .1); }

/* hero with the start picture */
.hero { position: relative; border-radius: 22px; overflow: hidden; margin: 6px 0 18px; aspect-ratio: 16 / 7;
  background: #000 center 15% / cover no-repeat; box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  border: 1px solid var(--card-b); }
.hero.small { aspect-ratio: 16 / 5; }
.hero .cta { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 16px; display: flex; gap: 10px;
  justify-content: center; flex-wrap: wrap; background: linear-gradient(transparent, rgba(10, 5, 25, .75)); }

/* buttons: gold like the game title, pink like the game page */
.btn, button { font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: 14px; padding: 12px 22px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.gold, button.gold { color: #4a1606; background: linear-gradient(180deg, var(--gold1), var(--gold2));
  box-shadow: 0 4px 0 var(--gold-edge), 0 8px 18px rgba(255, 160, 30, .25); text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn.gold:active, button.gold:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-edge); }
.btn.pink, button.pink { color: #fff; background: linear-gradient(180deg, #ff82bd, var(--pink));
  box-shadow: 0 4px 0 #a3245f; }
.btn.ghost, button.ghost { color: var(--text); background: rgba(255, 255, 255, .08); border: 1px solid var(--card-b); }
.btn.block, button.block { width: 100%; }

/* cards + layout */
.card { background: var(--card); border: 1px solid var(--card-b); border-radius: 20px; padding: 20px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.card + .card { margin-top: 16px; }
.grid2 > .card, .grid3 > .card { margin-top: 0; }
.narrow { max-width: 460px; margin: 0 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } .hero { aspect-ratio: 16 / 9; } }
@media (max-width: 560px) {
  .top { padding: 8px 0; }
  .lang button { padding: 6px 8px; }
  .lang button span { display: none; }
  .brand { flex: 1; min-width: 0; } .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand img { width: 34px; height: 34px; } .brand b { font-size: 19px; }
  .nav { width: 100%; flex-wrap: nowrap; gap: 4px; }
  .nav a { flex: 1; text-align: center; padding: 8px 4px; font-size: 13px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; background: rgba(255, 255, 255, .06); }
  .grid3.stats { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; } h1 { font-size: 24px; }
}
h1, h2 { font-family: "Lilita One", "Kantumruy Pro", sans-serif; font-weight: 400; letter-spacing: .3px; margin: 0 0 6px; }
h1 { font-size: 28px; } h2 { font-size: 21px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* steps on the home page */
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .n { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  color: #4a1606; background: linear-gradient(180deg, var(--gold1), var(--gold2)); box-shadow: 0 3px 0 var(--gold-edge); }

/* forms */
label.f { display: block; margin: 0 0 14px; font-size: 14px; }
label.f span { display: block; margin-bottom: 6px; color: var(--muted); }
input[type=text], input[type=password], input[type=tel], input:not([type]) {
  width: 100%; font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--card-b);
  border-radius: 12px; padding: 12px 14px; outline: none; }
input:focus { border-color: var(--gold2); box-shadow: 0 0 0 3px rgba(255, 178, 31, .25); }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border-radius: 10px;
  background: transparent; color: var(--muted); font-weight: 400; }
.meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* trap for bots */

/* messages */
.flash { border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; border: 1px solid; }
.flash.error { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .5); color: #ffd2d2; }
.flash.ok { background: rgba(76, 209, 138, .12); border-color: rgba(76, 209, 138, .5); color: #c9ffe1; }

/* my account */
.stats .s { background: rgba(0, 0, 0, .22); border-radius: 16px; padding: 12px 14px; }
.stats .k { font-size: 12px; color: var(--muted); }
.stats .v { font-size: 22px; font-weight: 800; }
.v.coin { color: var(--gold1); } .v.gold { color: #ffd34d; }
.badge { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 99px; font-weight: 700; }
.badge.on { background: rgba(76, 209, 138, .2); color: var(--green); }
.badge.off { background: rgba(255, 255, 255, .1); color: var(--muted); }
.items { display: flex; flex-wrap: wrap; gap: 8px; }
.items .it { width: 58px; height: 58px; border-radius: 14px; background: rgba(0, 0, 0, .25); display: grid; place-items: center;
  border: 1px solid var(--card-b); }
.items .it img { max-width: 44px; max-height: 44px; image-rendering: pixelated; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--card-b);
  font-size: 14px; }
.log li:last-child { border: 0; }
.log .fail { color: var(--red); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 0; }

/* phone held sideways (short and wide): picture on the left, form on the right, small header */
@media (orientation: landscape) and (max-height: 540px) {
  .wrap { padding-bottom: 16px; }
  .top { padding: 6px 0; }
  .brand img { width: 30px; height: 30px; } .brand b { font-size: 18px; } .brand small { display: none; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .lang button span { display: none; } .lang button { padding: 5px 8px; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
  .split .hero { position: sticky; top: 8px; margin: 0; aspect-ratio: auto; height: calc(100vh - 74px);
    max-height: 340px; min-height: 200px; background-position: center 30%; }
  .split .card.narrow { max-width: none; margin: 0; }
  .hero:not(.small) { aspect-ratio: auto; height: calc(100vh - 70px); max-height: 360px; }
  .card { padding: 14px 16px; } h1 { font-size: 22px; } h2 { font-size: 19px; }
  label.f { margin-bottom: 10px; } input[type=text], input[type=password], input:not([type]) { padding: 10px 12px; }
  footer { padding-top: 12px; }
}

/* how to play (/guide) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips a { text-decoration: none; color: var(--text); background: rgba(255,255,255,.08); border: 1px solid var(--card-b);
  padding: 5px 11px; border-radius: 99px; font-size: 14px; }
.chips a:hover { background: rgba(255,255,255,.16); }
details.g { margin-top: 14px; scroll-margin-top: 10px; }
details.g > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.g > summary::-webkit-details-marker { display: none; }
details.g > summary::after { content: "▾"; color: var(--gold1); font-size: 20px; transition: transform .2s; }
details.g:not([open]) > summary::after { transform: rotate(-90deg); }
details.g > summary h2 { margin: 0; }
details.g[open] > summary { margin-bottom: 12px; }
details.g ul, details.g ol { margin: 0; padding-left: 22px; } details.g li { margin: 6px 0; }
details.g .step + .step { margin-top: 10px; }
.g .row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--card-b); }
.g .row:first-of-type { border-top: 0; }
.g .row b { color: var(--gold1); }
.tip { margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; background: rgba(255,178,31,.12); border: 1px solid rgba(255,178,31,.35); }
.npcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 10px 0; }
.npc { background: rgba(0,0,0,.18); border: 1px solid var(--card-b); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.npc b { color: var(--gold1); } .npc small { color: var(--muted); font-size: 12px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 0; }
.guide-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); margin-top: 16px; }
.guide-link > span:first-child { font-size: 28px; } .guide-link div { flex: 1; display: flex; flex-direction: column; }
.guide-link > span:last-child { font-size: 26px; color: var(--gold1); }
@media (max-width: 560px) { .g .row { grid-template-columns: 1fr; gap: 2px; } .npcs { grid-template-columns: 1fr; } }
