/* Game look for the top-up page (/charge/). Loaded after /assets/gh-game/css/tokens.css.
   Styles only: every id, data-t key and element the payment script reads or builds is kept.
   No inline styles and no outside fonts, because the page's security policy allows this site only. */

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.6; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(var(--scene-tint), var(--scene-tint)), var(--scene) center / cover no-repeat; }
a { color: inherit; }
button, select, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8bbef1; outline-offset: 2px; }

/* top bar = the client's tab row */
.bar { position: sticky; top: 0; z-index: 5; background: linear-gradient(#ffffff26, #00000026), var(--header-bg); border-bottom: 2px solid #c59e81; box-shadow: 0 1px 0 #432a1f, 0 6px 14px #0004; }
.bar-in { max-width: 1200px; margin: auto; padding: 10px 20px; min-height: 64px; display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand span { font-family: var(--font-display); font-weight: 900; font-size: 1.35rem; color: #e9ecf2; letter-spacing: .02em; direction: ltr;
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; }
.brand b { color: #ffb020; }
.bar nav { display: flex; gap: 8px; margin-inline-start: 10px; }
.tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

/* silver game buttons with a bronze rim, blue when hovered or chosen */
.bar nav a, .theme-switch button, #language, button.quiet {
  display: inline-grid; place-items: center; min-height: 34px; padding: 4px 14px; cursor: pointer; text-decoration: none;
  color: #1b1d24; font-weight: 700; text-shadow: 0 1px 0 #ffffff99; border-radius: 5px; border: 1px solid #4e5060;
  background: linear-gradient(#f8f8f8 0%, #c5c9db 14%, #babbca 34%, #abaab7 54%, #a3a4ad 70%, #90909e 88%, #6f7282 100%);
  box-shadow: 0 0 0 2px #c59e81, 0 0 0 3px #432a1f, inset 0 1px 0 #fffc;
}
.bar nav a:hover, .theme-switch button:hover, .theme-switch button[aria-pressed="true"], #language:hover, button.quiet:hover {
  color: #fff; text-shadow: 0 1px 1px #00306b; border-color: #0a3d7a;
  background: linear-gradient(#f0f6fc 0%, #8bbef1 14%, #75ade9 32%, #5799e2 52%, #4792de 68%, #217ad8 86%, #005bcd 100%);
}
.theme-switch { display: inline-flex; gap: 6px; }
.theme-switch button { width: 34px; height: 34px; padding: 0; }
.theme-switch svg { width: 16px; height: 16px; }
#language { min-width: 34px; padding: 4px 10px; }
#language[lang="ar"] { font-family: "Noto Kufi Arabic", Tahoma, sans-serif; }

main { max-width: 1200px; margin: auto; padding: 34px 20px 20px; }

/* title = a tab over a window, like the client's Shop window */
.eyebrow { display: inline-block; margin: 0; padding: 4px 16px; color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .08em; direction: ltr;
  border-radius: 6px 6px 0 0; background: linear-gradient(#5d6a7c, #2b3442); border: 2px solid #c59e81; border-bottom: 0; }
.hero-win, .panel { background: var(--win); color: var(--ink); border: 2px solid #c59e81; border-radius: 8px;
  box-shadow: 0 0 0 1px #432a1f, inset 0 0 0 1px #f1dccb88, 0 10px 28px #0006; }
.hero-win { padding: 22px 26px; border-start-start-radius: 0; }
h1, h2 { font-family: var(--font-display); font-weight: 900; color: var(--title); text-shadow: var(--title-shadow); line-height: 1.35; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); margin: 0 0 8px; }
h2 { font-size: 1.45rem; margin: 0 0 8px; }
.intro { margin: 0; font-size: 1.05rem; color: var(--muted); max-width: 820px; }
.panel { padding: 24px; }

/* login window */
#login { max-width: 500px; margin: 30px auto; }
#login > p { color: var(--muted); margin-top: 0; }
label { display: block; margin: 14px 0 6px; font-weight: 700; color: var(--ink); }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; background: #fff; color: #1b1d24; border: 1px solid #8e91a0; border-radius: 3px; box-shadow: inset 0 2px 3px #0002; }
input:focus-visible, select:focus-visible { outline: none; border-color: #217ad8; box-shadow: 0 0 0 2px #8bbef1; }
select:disabled { opacity: .7; }

/* main action = the client's green button */
#login-form button, .package > button, #refresh {
  min-height: 44px; padding: 10px 18px; cursor: pointer; font-weight: 700;
  color: #fff; text-shadow: 0 1px 1px #1f5410; border: 1px solid #23590f; border-radius: 5px;
  background: linear-gradient(#e3fbb8 0%, #a6e65a 16%, #8fd64c 40%, #6fc03d 62%, #58b035 80%, #3f8f22 100%);
  box-shadow: inset 0 1px 0 #ffffffaa, 0 2px 3px #0005;
}
#login-form button:hover, .package > button:hover:not(:disabled), #refresh:hover {
  background: linear-gradient(#f0ffd2 0%, #b8f26c 16%, #9fe25a 40%, #7fcd48 62%, #63bb3c 80%, #489a28 100%);
}
button:disabled { cursor: not-allowed; filter: grayscale(.9); opacity: .6; }
#login-form button { width: 100%; margin-top: 22px; }

/* receiving account + recipient character */
.account-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 26px 0; }
.account-row > div { flex: 1; min-width: 0; }
.account-row label:first-child { margin-top: 0; }
.account-row select { max-width: 480px; }
.account-row p, .payment-note { color: var(--muted); font-size: .92rem; line-height: 1.8; }
.account-row .first-payment-note { color: var(--gold-text); font-weight: 700; max-width: 780px; }
#recipient-note { margin-bottom: 0; }

/* the black tutorial popup of the client */
.notice, #message { background: #000000c4; color: #fff; border: 1px solid #d2b59c; border-inline-start: 4px solid var(--yellow); border-radius: 2px; padding: 12px 16px; font-weight: 700; line-height: 1.8; }
#message { white-space: pre-line; margin: 20px 0; }
#message:empty { display: none; }

/* packages = item cards of the in-game Shop */
.packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.package { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 0 16px 16px;
  background: var(--win-2); border: 2px solid #c59e81; border-radius: 8px; box-shadow: 0 0 0 1px #432a1f, inset 0 0 0 1px #f1dccb88, 0 8px 20px #0005; }
.package > .credits:first-child { margin: 0 -16px; padding: 18px 16px 14px; text-align: center; border-radius: 6px 6px 0 0;
  background: linear-gradient(#5f5164, #3f3445); border-bottom: 2px solid #c59e81; color: #ffd24a; font-family: var(--font-display);
  text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; }
.credits { font-size: 1.75rem; line-height: 1.4; font-weight: 900; unicode-bidi: plaintext; overflow-wrap: anywhere; }
.bonus-credits { font-weight: 700; color: #2e8a12; unicode-bidi: plaintext; text-align: center; line-height: 1.6; }
.base-credits { color: var(--muted); unicode-bidi: plaintext; }
.package .price { font-family: var(--font-num); font-size: 1.15rem; font-weight: 700; color: var(--ink); direction: ltr; text-align: center; }
.package .charge-price { font-size: .9rem; color: var(--muted); text-align: center; unicode-bidi: plaintext; }
.package > button { margin-top: auto; width: 100%; font-size: .95rem; line-height: 1.4; }
.payment-note { margin: 0; padding: 10px 16px; border-radius: 6px; background: var(--win); border: 1px solid #c59e81; box-shadow: 0 0 0 1px #432a1f; }
.retry-note { margin: 0; font-size: .85rem; line-height: 1.7; color: #b4540a; font-weight: 700; }
.package .notice { margin: 14px 0 0; }

/* gifts = inventory cells */
.gift-list { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); }
.gift-list:empty { display: none; }
.gift-row { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 10px; line-height: 1.6; }
.gift-row:last-child { margin-bottom: 0; }
.gift-row img { flex: none; box-sizing: content-box; padding: 5px; object-fit: contain; border-radius: 4px; background: linear-gradient(#56495b, #3f3445); border: 1px solid #75677a; }
.gift-row > div { min-width: 0; }
.gift-name { font-size: .92rem; font-weight: 700; overflow-wrap: anywhere; }
.gift-condition { display: block; margin-top: 3px; font-size: .78rem; line-height: 1.7; color: var(--muted); }

/* order receipt */
#receipt { margin-top: 26px; }
#order-status, #order-gifts { line-height: 1.8; }
#order-status { font-weight: 700; color: var(--accent-text); }
#order-total { unicode-bidi: plaintext; font-weight: 700; }
#order-credits { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
#order-credits .credits { font-size: 1.4rem; color: var(--gold-text); }
#order-gifts { margin: 20px 0; padding-top: 6px; border-top: 1px solid var(--line); }
#order-gifts .gift-list { border-top: 0; max-width: 620px; }
.receipt-recipient { font-weight: 700; overflow-wrap: anywhere; }
.gift-delivery-status { color: #2e8a12; font-weight: 700; }
.reference { font: .78rem ui-monospace, Consolas, monospace; overflow-wrap: anywhere; direction: ltr; color: var(--muted); }

/* links under the page */
footer { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 36px; padding: 16px 20px; border-radius: 8px;
  background: var(--header-bg); border: 2px solid #c59e81; box-shadow: 0 0 0 1px #432a1f; font-weight: 700; }
footer a { color: var(--accent-text); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* dark theme: brighter text for green and orange accents on charcoal windows */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bonus-credits, :root:not([data-theme="light"]) .gift-delivery-status { color: #7fe05e; }
  :root:not([data-theme="light"]) .retry-note { color: #ffb45a; }
}
:root[data-theme="dark"] .bonus-credits, :root[data-theme="dark"] .gift-delivery-status { color: #7fe05e; }
:root[data-theme="dark"] .retry-note { color: #ffb45a; }

@media (max-width: 900px) {
  .packages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .bar-in { flex-wrap: wrap; padding: 8px 14px; gap: 10px; }
  .bar nav { order: 3; width: 100%; margin: 0; padding-bottom: 4px; }
  .bar nav a { flex: 1; }
  main { padding: 22px 14px; }
  .hero-win, .panel { padding: 18px; }
  .account-row { flex-direction: column; align-items: stretch; }
  .account-row select { max-width: none; }
  .packages { grid-template-columns: 1fr; }
  .credits { font-size: 1.55rem; }
}
