/* Bảng màu và kích thước chính của giao diện Dark Arcade. */
:root {
  color-scheme: dark;
  --page-bg: #1a1c2c;
  --panel-bg: #24283b;
  --panel-border: #454b67;
  --text: #f4f4f4;
  --muted: #b7bdd0;
  --accent: #ffcc4d;
  --green: #70e090;
  --pixel-font: "Pixelify Sans", "Courier New", monospace;
  --mono-font: "IBM Plex Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background-color: var(--page-bg);
  background-image:
    linear-gradient(rgba(147, 161, 197, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 161, 197, .045) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0, #2c3150 0, var(--page-bg) 62%);
  background-size: 8px 8px, 8px 8px, 100% 100%;
  font-family: var(--mono-font);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: 100%;
  padding: 48px 20px;
}

.arcade-frame {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 28px;
  border: 4px solid var(--panel-border);
  background: rgba(26, 28, 44, .94);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(255, 255, 255, .025);
}

.profile {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 32px 0 26px;
  border-bottom: 2px dashed #464d68;
}

.avatar {
  display: block;
  width: 104px;
  height: 104px;
  border: 4px solid var(--accent);
  border-radius: 0;
  object-fit: cover;
  image-rendering: pixelated;
  box-shadow: 4px 4px 0 #11131d;
}

.profile-info {
  min-width: 0;
  padding-top: 2px;
}

.profile h1,
.group-title,
.page-footer,
.qr-dialog h2 {
  font-family: var(--pixel-font);
  font-weight: 700;
}

.profile h1 {
  margin: 0;
  padding-right: 76px;
  color: var(--accent);
  font-size: 30px;
  line-height: 1.1;
}

.handle {
  margin: 4px 0 9px;
  color: var(--muted);
  font-size: 12px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
}

.profile-badge,
.online-status {
  font-family: var(--pixel-font);
  font-size: 13px;
  line-height: 1.25;
}

.profile-badge {
  padding: 3px 7px;
  border: 1px solid #6f7590;
  color: #e3e7f2;
  background: #30354b;
}

.online-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(112, 224, 144, .7);
}

.profile-tools {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  gap: 8px;
}

.tool-button.nes-btn,
.copy-button.nes-btn,
.dialog-close.nes-btn {
  min-width: 36px;
  height: 36px;
  padding: 3px;
  color: var(--text);
  background-color: #343a52;
  font-family: var(--pixel-font);
  font-size: 18px;
  line-height: 1;
}

.tool-button[aria-pressed="true"] {
  color: #1a1c2c;
  background-color: var(--accent);
}

.bio-balloon.nes-balloon {
  width: 100%;
  margin: 0;
  padding: 11px 13px;
  border-color: #626985;
  background-color: #2a3045;
  font-family: var(--mono-font);
}

.bio-balloon p {
  margin: 0;
  color: #e5e8f1;
  font-size: 12px;
  line-height: 1.7;
}

.link-group {
  margin-top: 25px;
}

.group-title {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: .3px;
}

.group-title span {
  color: #8d96b7;
}

.link-list {
  display: grid;
  gap: 10px;
}

.link-card.nes-btn {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  padding: 10px 15px;
  border: 2px solid #747b99;
  color: var(--text);
  background-color: var(--panel-bg);
  box-shadow: 4px 4px 0 #10121c;
  text-align: left;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background-color .12s ease;
}

.link-card.nes-btn::after {
  position: absolute;
  top: 50%;
  left: 7px;
  color: var(--accent);
  content: "▶";
  font-size: 10px;
  opacity: 0;
  transform: translate(-5px, -50%);
  transition: opacity .12s ease, transform .12s ease;
}

.link-card.nes-btn:hover,
.link-card.nes-btn:focus-visible {
  border-color: var(--accent);
  background-color: #30364d;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #10121c;
}

.link-card.nes-btn:hover::after,
.link-card.nes-btn:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.link-card.nes-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #10121c;
}

.link-icon {
  display: flex;
  width: 40px;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.link-icon .nes-icon {
  transform: scale(.82);
}

.icon-backdrop {
  border: 2px solid #d5d9e3;
  background: #f0f1f3;
}

.link-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}

.link-copy strong {
  overflow-wrap: anywhere;
  color: #fff;
  font-family: var(--pixel-font);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}

.link-copy small {
  color: var(--muted);
  font-family: var(--mono-font);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
}

.link-arrow {
  margin-left: auto;
  color: #8b93ae;
  font-size: 12px;
  opacity: .8;
}

.custom-icon svg {
  display: block;
  width: 32px;
  height: 32px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.tiktok-icon {
  color: #f5f6fa;
  filter: drop-shadow(2px 0 #fe3f67) drop-shadow(-2px 0 #33e6e5);
}

.locket-icon {
  color: #ffd45a;
}

.locket-icon .icon-cutout,
.book-icon .icon-detail,
.zalo-icon .icon-detail,
.bank-mb-icon .icon-detail,
.bank-vcb-icon .icon-detail {
  fill: none;
  stroke: var(--panel-bg);
  stroke-linecap: square;
  stroke-width: 2.5;
}

.book-icon {
  color: #93c9ff;
}

.zalo-icon {
  color: #62b9ff;
}

.zalo-icon .icon-detail {
  stroke: #1d5eaa;
}

.bank-mb-icon {
  color: #ffd45a;
}

.bank-vcb-icon {
  color: #68dc93;
}

.contact-card.nes-btn {
  padding: 0 8px 0 14px;
  cursor: default;
}

.contact-main {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 14px;
  align-self: stretch;
  color: inherit;
  text-decoration: none;
}

.copy-button.nes-btn {
  position: relative;
  z-index: 1;
  min-width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--accent);
  font-size: 20px;
}

.copy-card {
  cursor: pointer;
}

.page-footer {
  margin-top: 30px;
  color: #858da9;
  font-size: 12px;
  text-align: center;
}

.page-footer span {
  padding: 0 5px;
  color: var(--accent);
}

.qr-dialog.nes-dialog {
  width: min(390px, calc(100% - 32px));
  padding: 30px 24px 24px;
  border: 4px solid var(--accent);
  color: var(--text);
  background: #22263a;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .5);
  text-align: center;
}

.qr-dialog::backdrop {
  background: rgba(7, 9, 18, .78);
}

.dialog-close.nes-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

.qr-dialog h2 {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 22px;
}

.qr-code {
  display: flex;
  width: 220px;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 10px;
  background: white;
  image-rendering: pixelated;
}

.qr-code canvas,
.qr-code img {
  display: block;
  max-width: 100%;
}

.qr-unavailable {
  color: #282828;
  font: 12px/1.5 var(--mono-font);
  overflow-wrap: anywhere;
}

.qr-url {
  margin: 0;
  color: var(--muted);
  font: 10px/1.5 var(--mono-font);
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 5;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border: 3px solid var(--green);
  color: #fff;
  background: #20283a;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .5);
  font-family: var(--pixel-font);
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: #ff7777;
}

@media (max-width: 600px) {
  .page-shell {
    padding: 22px 4%;
  }

  .arcade-frame {
    padding: 20px;
  }

  .profile {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
  }

  .avatar {
    width: 84px;
    height: 84px;
  }

  .profile h1 {
    font-size: 26px;
  }

  .link-card.nes-btn {
    gap: 10px;
    padding-right: 10px;
    padding-left: 12px;
  }

  .contact-card.nes-btn {
    padding-left: 12px;
  }

  .contact-main {
    gap: 10px;
  }

  .link-icon {
    width: 36px;
    min-width: 36px;
  }
}

@media (max-width: 479px) {
  .page-shell {
    padding: 12px 3.5%;
  }

  .arcade-frame {
    padding: 15px 13px;
    border-width: 3px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .35);
  }

  .profile {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 11px;
    padding-top: 43px;
  }

  .avatar {
    width: 68px;
    height: 68px;
    border-width: 3px;
  }

  .profile h1 {
    padding-right: 0;
    font-size: 24px;
  }

  .handle {
    font-size: 11px;
  }

  .profile-badge,
  .online-status {
    font-size: 12px;
  }

  .badges {
    gap: 5px;
    margin-bottom: 10px;
  }

  .bio-balloon.nes-balloon {
    grid-column: 1 / -1;
    margin-top: 3px;
  }

  .bio-balloon p {
    font-size: 11px;
  }

  .group-title {
    font-size: 15px;
  }

  .link-card.nes-btn {
    min-height: 68px;
    gap: 8px;
    padding: 9px 8px;
  }

  .link-card.nes-btn::after {
    left: 3px;
    font-size: 8px;
  }

  .link-icon {
    width: 32px;
    min-width: 32px;
    height: 36px;
  }

  .link-icon .nes-icon {
    transform: scale(.72);
  }

  .custom-icon svg {
    width: 29px;
    height: 29px;
  }

  .link-copy strong {
    font-size: 16px;
  }

  .link-copy small {
    font-size: 9px;
  }

  .contact-card.nes-btn {
    padding-right: 6px;
    padding-left: 8px;
  }

  .contact-main {
    gap: 8px;
  }

  .copy-button.nes-btn {
    min-width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
