:root {
  --bg: #000;
  --panel: rgba(14, 16, 22, .78);
  --panel2: rgba(11, 12, 16, .86);
  --line: rgba(255, 255, 255, .14);
  --text: #cfd2d8;
  --white: #fff;

  --accent: rgba(57, 208, 255, .95);
  --accentLine: rgba(57, 208, 255, .55);

  --shadow: 0 14px 40px rgba(0, 0, 0, .55);
  /* Original radius was 14px */
  --radius: 14px;

  /* Adjusted path for external CSS file */
  --bg-image: url("../../game_bg.png");
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
}

/* Background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 50% 20%, rgba(57, 208, 255, .10), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, .60), rgba(0, 0, 0, .90)),
    var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.bg.noimg {
  background:
    radial-gradient(1200px 700px at 50% 20%, rgba(57, 208, 255, .10), transparent 55%),
    radial-gradient(circle at 50% 20%, #111 0%, #000 55%, #000 100%);
}

/* Single column layout (PC too) */
.app {
  height: 100svh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: env(safe-area-inset-top) 10px env(safe-area-inset-bottom);
  overflow: hidden;
}

.gameCol {
  /* User requested 520~640px for PC max width */
  width: min(600px, 100vw);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  justify-items: center;
  align-items: stretch;

  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

/* GlassPanel helper to replace the removed class if it was used in HTML, 
   but we should revert the HTML classes too? 
   No, the HTML uses 'glassPanel' in the clean up. 
   I need to support 'glassPanel' but with ORIGINAL style look.
   Original .topBar style:
     background: var(--panel);
     backdrop-filter: blur(10px);
     border:1px solid var(--line);
     box-shadow: var(--shadow);
*/
.glassPanel {
  background: var(--panel) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
  border-radius: var(--radius) !important;
}


/* Top bar */
.topBar {
  width: min(600px, 96vw);
  /* Match gameCol */
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1.35;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand .title {
  font-size: 11px;
  color: var(--white);
  letter-spacing: .6px;
}

.brand .sub {
  opacity: .82;
}

.btnRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

/* Buttons */
button {
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 10px;
  background: rgba(16, 19, 27, .72);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .08s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) inset;
}

button:hover {
  background: rgba(23, 27, 39, .78);
}

button:active {
  transform: translateY(1px) scale(.99);
}

button:focus-visible {
  outline: none;
  border-color: rgba(57, 208, 255, .55);
  box-shadow: 0 0 0 2px rgba(57, 208, 255, .18), 0 0 0 1px rgba(0, 0, 0, .12) inset;
}

button.primary {
  border-color: var(--accentLine);
  box-shadow: 0 0 0 1px rgba(57, 208, 255, .12) inset;
}

.iconBtn {
  padding: 10px 10px;
  min-width: 40px;
}

/* Material symbols styling */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-.5px);
}

/* Canvas */
#c {
  place-self: center;
  width: auto;
  max-width: 96vw;
  height: auto;
  max-height: calc(100svh - 230px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: var(--shadow);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Tips */
.tips {
  width: min(600px, 96vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: 12px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  line-height: 1.75;
  max-height: 200px;
  overflow: auto;
}

.tips b {
  color: var(--white);
}

.tips .tag {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid var(--accentLine);
  color: var(--accent);
  border-radius: 999px;
  margin-right: 6px;
  transform: translateY(-1px);
}

/* Modal base */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
  z-index: 999;
}

.overlay.open {
  display: flex;
}

.card {
  width: min(680px, 92vw);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 12, 16, .90);
  backdrop-filter: blur(12px);
  padding: 16px;
  font-family: "Press Start 2P", monospace;
  color: var(--text);
  box-shadow: var(--shadow);
}

.cardHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cardTitle {
  font-size: 12px;
  color: var(--white);
  letter-spacing: .4px;
}

.cardBody {
  font-size: 10px;
  line-height: 1.95;
  opacity: .95;
  border-top: 1px dashed rgba(255, 255, 255, .14);
  padding-top: 12px;
}

.kbd {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-bottom-width: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  margin: 0 4px 2px 0;
}

/* Audio Gate */
.audioGate {
  z-index: 998;
}

.audioCard {
  width: min(560px, 92vw);
}

.audioRow {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Hamburger menu drawer - Kept from new but styled like original card */
.drawer {
  width: min(520px, 92vw);
}

.snsList {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.snsItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(16, 19, 27, .45);
  text-decoration: none;
  color: var(--text);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}

.snsItem:hover {
  background: rgba(23, 27, 39, .62);
  border-color: rgba(57, 208, 255, .30);
}

.snsLeft {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.snsName {
  color: var(--white);
  font-size: 10px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snsUrl {
  font-size: 9px;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chev {
  opacity: .9;
}

/* small helper */
.muted {
  opacity: .85;
}

@media (min-width: 720px) {
  .app {
    padding: 18px 22px;
  }

  #c {
    max-height: calc(100svh - 250px);
  }
}

/* Overlay */
.overlay-gameover {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  z-index: 80;
}

.overlay-gameover.open {
  display: flex;
}

.overCard {
  border: 1px solid var(--line);
  background: #0b0c10f2;
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 16px 18px;
  font-family: "Press Start 2P", monospace;
  text-align: center;
  width: min(420px, 92vw);
}

.overTitle {
  color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
}

#btnTry {
  width: 100%;
  padding: 14px 12px;
  font-size: 10px;
}