/* Game menu opened by the Menu button (see theme.css for the colors) */
/* The window has a fixed size for all its pages, so navigating never moves or resizes it */
#game-menu-modal {
  width: 640px;
  max-width: 94vw;
  user-select: none;
}

#game-menu-modal .modal-header {
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* Clicks on a button always land on the button itself (see GameMenuModal.__internalButtonClick) */
#game-menu-modal button[action] * {
  pointer-events: none;
}

.game-menu-body {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: min(470px, 76vh);
  padding: 12px;
}

/* Pages: only the active page is shown, with a short fade */
.game-menu-page {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.game-menu-page.active {
  display: flex;
  animation: game-menu-page-in 0.18s ease-out;
}

@keyframes game-menu-page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Character banner: portrait, name, level and vocation, and the world time on the right */
.game-menu-hero {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--color-accent-dark);
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 0% 0%, var(--color-accent-haze), transparent 60%),
    var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.6);
}

.game-menu-portrait {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  background-image: radial-gradient(circle at 50% 35%, #5a5a5a, #1a1a1a 75%);
  box-shadow: 0 0 8px var(--color-accent-glow), inset 0 0 8px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

/* The 40px outfit preview is shown at 1.5 times its size */
.game-menu-portrait canvas {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  image-rendering: pixelated;
}

.game-menu-hero-info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.game-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: bold;
  color: var(--color-accent-text);
}

.game-menu-hero-details {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.game-menu-level {
  padding: 0 6px;
  font-size: 10px;
  color: var(--color-accent);
  border: 1px solid var(--color-accent-dark);
  border-radius: 7px;
  background-color: rgba(0, 0, 0, 0.45);
}

.game-menu-hero-time {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-muted);
}

#game-menu-time {
  font-weight: bold;
  color: var(--color-text-soft);
}

/* Store cards under the banner: the premium status and the Novibia Points, each with a gold button to the website shop.
   They are the most visible part of the home page: accent border, gold haze and glow */
.game-menu-store {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.game-menu-store-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 6px;
  border: 1px solid var(--color-accent);
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 15% 50%, var(--color-accent-haze), transparent 70%),
    var(--gradient-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 8px var(--color-accent-glow);
}

/* Free accounts: the premium card breathes to draw the eye */
.game-menu-store-card.free {
  animation: game-menu-store-glow 2.4s ease-in-out infinite;
}

@keyframes game-menu-store-glow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 6px var(--color-accent-glow); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 14px var(--color-accent-glow); }
}

/* The left part of a card (icon and texts) opens its page in the menu */
#game-menu-modal button.game-menu-store-info {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  text-align: left;
  border: none;
  background: none;
  box-shadow: none;
}

/* The id beats the size of .novibia-coin */
#game-menu-modal .game-menu-store-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 6px var(--color-accent-glow));
  transition: transform 0.12s;
}

#game-menu-modal button.game-menu-store-info:hover .game-menu-store-icon {
  transform: scale(1.08) rotate(-4deg);
}

#game-menu-modal .game-menu-store-icon .icon-hole {
  fill: var(--color-accent-darker);
}

.game-menu-store-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.game-menu-store-amount {
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
  color: var(--color-accent-text);
  text-shadow: 0 0 6px var(--color-accent-glow);
}

.game-menu-store-subtitle {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-soft);
}

#game-menu-modal button.game-menu-store-info:hover .game-menu-store-subtitle {
  color: var(--color-accent-text);
}

/* The gold button of a card keeps its size */
.game-menu-store-card .game-menu-upgrade {
  flex: 0 0 auto;
}

.game-menu-account-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-soft);
  border: 1px solid #5a5a5a;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.45);
}

.game-menu-account-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #8a8a8a;
}

/* Premium accounts get the gold accent */
.game-menu-account-badge.premium {
  color: var(--color-accent-text);
  border-color: var(--color-accent);
}

.game-menu-account-badge.premium::before {
  background-color: var(--color-accent);
  box-shadow: 0 0 4px var(--color-accent-glow);
}

/* Premium time left of a premium account in the character list (empty and hidden for free accounts) */
.game-menu-account-days {
  font-size: 10px;
  color: var(--color-accent-text);
}

.game-menu-account-days:empty {
  display: none;
}

/* Novibia Points coin: a gold coin with an N (store card, Novibia Points page and character list) */
.novibia-coin {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 0 2px var(--color-accent-glow));
}

.novibia-coin.large {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 8px var(--color-accent-glow));
}

.novibia-coin-edge {
  fill: var(--color-accent);
}

.novibia-coin-face {
  fill: var(--color-accent-dark);
}

.novibia-coin-mark {
  fill: var(--color-accent-text);
}

/* Gold call to action with a light sweeping over it */
#game-menu-modal button.game-menu-upgrade {
  position: relative;
  margin: 0;
  padding: 5px 14px;
  overflow: hidden;
  font-size: 11px;
  color: var(--color-accent-darker);
  text-shadow: none;
  border: 1px solid var(--color-accent-darker);
  border-radius: 6px;
  background-image: linear-gradient(to bottom, var(--color-accent-text), var(--color-accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 8px var(--color-accent-glow);
  transition: transform 0.12s, box-shadow 0.12s;
}

#game-menu-modal button.game-menu-upgrade::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg);
  animation: game-menu-shine 3s ease-in-out infinite;
}

@keyframes game-menu-shine {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}

#game-menu-modal button.game-menu-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 12px var(--color-accent-glow);
}

#game-menu-modal button.game-menu-upgrade.large {
  align-self: center;
  margin-top: 14px;
  padding: 9px 28px;
  font-size: 13px;
}

/* Section titles: a short gold bar, the name and a fading line */
.game-menu-section {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
  color: var(--color-accent);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.game-menu-section::before {
  content: "";
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--color-accent);
  box-shadow: 0 0 4px var(--color-accent-glow);
}

.game-menu-section::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.2), transparent);
}

/* Home page: tighter section titles, so the store cards and every row fit without scrolling */
.game-menu-page[page="home"] .game-menu-section {
  margin: 6px 0 4px;
}

/* The store cards already keep a gap below them */
.game-menu-page[page="home"] .game-menu-store + .game-menu-section {
  margin-top: 0;
}

/* Rows: two columns, one column on narrow screens */
.game-menu-rows {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
}

#game-menu-modal button.game-menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 4px 10px 4px 4px;
  text-align: left;
  border: 1px solid black;
  border-radius: 8px;
  background-image: linear-gradient(to right, #444444, #2a2a2a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: border-color 0.12s, box-shadow 0.12s, background-image 0.12s;
}

#game-menu-modal button.game-menu-row:hover {
  border-color: var(--color-accent);
  background-image: linear-gradient(to right, var(--color-accent-dark), var(--color-accent-darker));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 6px var(--color-accent-glow);
}

/* Icon in a rounded dark frame */
.game-menu-medallion {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--color-accent-dark);
  border-radius: 10px;
  background-image: radial-gradient(circle at 30% 25%, #555555, #1a1a1a 80%);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
  transition: transform 0.12s;
}

.game-menu-medallion svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
}

/* Smaller icons in the rows of the home page, so every row fits without scrolling */
.game-menu-row .game-menu-medallion {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.game-menu-row .game-menu-medallion svg {
  width: 24px;
  height: 24px;
}

#game-menu-modal button.game-menu-row:hover .game-menu-medallion {
  transform: scale(1.06) rotate(-3deg);
  border-color: var(--color-accent);
}

.game-menu-medallion.large {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}

.game-menu-medallion.large svg {
  width: 52px;
  height: 52px;
}

.game-menu-row-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.game-menu-row-title {
  font-size: 12px;
  font-weight: bold;
}

.game-menu-row-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: normal;
  color: var(--color-text-muted);
}

/* Small labels: "Soon" for sub-menus that are not available yet, gold "Premium" for premium content */
.game-menu-tag {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid #5a5a5a;
  border-radius: 7px;
  background-color: rgba(0, 0, 0, 0.45);
}

.game-menu-tag.premium {
  color: var(--color-accent-darker);
  border-color: var(--color-accent);
  background-image: linear-gradient(to bottom, var(--color-accent-text), var(--color-accent));
  text-shadow: none;
}

.game-menu-tag svg {
  width: 9px;
  height: 9px;
}

.game-menu-tag svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.game-menu-tag svg rect {
  fill: currentColor;
}

/* Arrow on the right of a row */
.game-menu-chevron {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-right: 2px;
  border: solid #8a8a8a;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
  transition: transform 0.12s, border-color 0.12s;
}

#game-menu-modal button.game-menu-row:hover .game-menu-chevron {
  border-color: var(--color-accent);
  transform: translateX(2px) rotate(45deg);
}

/* Page of a sub-menu that is not available yet */
.game-menu-placeholder {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.game-menu-placeholder-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-accent-text);
}

.game-menu-placeholder-text {
  max-width: 320px;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.game-menu-placeholder .game-menu-tag {
  font-size: 9px;
  padding: 2px 8px;
}

/* Premium page */
.game-menu-premium {
  display: flex;
  flex-direction: column;
  padding: 4px 8px 8px;
}

.game-menu-premium-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--color-accent-dark);
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 50% 0%, var(--color-accent-haze), transparent 70%),
    var(--gradient-card);
}

.game-menu-crown {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 0 8px var(--color-accent-glow));
}

.game-menu-premium-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--color-accent-text);
}

.game-menu-premium-text {
  max-width: 380px;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.game-menu-premium-text b {
  color: white;
  font-weight: bold;
}

.game-menu-premium-days {
  font-size: 12px;
  font-weight: bold;
  color: var(--color-accent-text);
}

.game-menu-premium-days:empty {
  display: none;
}

/* Novibia Points page: the balance in a card like the premium hero, two facts and the link to the website shop */
.novibia-points {
  display: flex;
  flex-direction: column;
  padding: 4px 8px 8px;
}

.novibia-points-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  text-align: center;
  border: 1px solid var(--color-accent-dark);
  border-radius: 10px;
  background-image:
    radial-gradient(circle at 50% 0%, var(--color-accent-haze), transparent 70%),
    var(--gradient-card);
}

.novibia-points-label {
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.novibia-points-balance {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-accent-text);
  text-shadow: 0 0 8px var(--color-accent-glow);
}

.novibia-points-text {
  max-width: 380px;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.novibia-points-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.novibia-points-fact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: normal;
  line-height: 1.45;
  color: var(--color-text-soft);
  border: 1px solid black;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.3);
}

.novibia-points-fact b {
  display: block;
  margin-bottom: 1px;
  font-size: 11px;
  color: white;
}

.novibia-points-fact .material-icons {
  flex: 0 0 auto;
  font-size: 16px;
  color: var(--color-accent);
}

.game-menu-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.game-menu-benefit {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: normal;
  line-height: 1.45;
  color: var(--color-text-soft);
  border: 1px solid black;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.3);
}

.game-menu-benefit b {
  display: block;
  margin-bottom: 1px;
  font-size: 11px;
  color: white;
}

.game-menu-benefit-check {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 4px var(--color-accent-glow);
}

.game-menu-benefit-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 3px;
  height: 6px;
  border: solid var(--color-accent-darker);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Icon artwork: gold accent with light grey details */
#game-menu-modal .icon-gold {
  fill: var(--color-accent);
}

#game-menu-modal .icon-light {
  fill: var(--color-icon-light);
}

#game-menu-modal .icon-back {
  opacity: 0.75;
}

#game-menu-modal .icon-outline {
  stroke: var(--color-surface-bottom);
  stroke-width: 2;
}

#game-menu-modal .icon-paper {
  fill: var(--color-accent-text);
}

#game-menu-modal .icon-ink {
  fill: var(--color-accent-dark);
}

#game-menu-modal .icon-check {
  fill: none;
  stroke: var(--color-accent-dark);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#game-menu-modal .icon-gear-teeth {
  fill: none;
  stroke: var(--color-accent);
}

#game-menu-modal .icon-gear-teeth-light {
  fill: none;
  stroke: var(--color-icon-light);
}

#game-menu-modal .icon-hole {
  fill: var(--color-surface-bottom);
}

#game-menu-modal .icon-shield {
  fill: var(--color-accent-dark);
  stroke: var(--color-accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

#game-menu-modal .icon-block {
  fill: rgba(0, 0, 0, 0.6);
  stroke: var(--color-error);
  stroke-width: 3;
}

#game-menu-modal .icon-block-line {
  stroke: var(--color-error);
  stroke-width: 3;
  stroke-linecap: round;
}

/* Narrow screens: the world time goes below the name */
@media (max-width: 520px) {
  .game-menu-hero {
    flex-wrap: wrap;
  }
}
