:root {
  --bg: #eee6dc;
  --bg-dark: #ded1c2;
  --text: #30251e;
  --muted: #76675b;

  --wood-light: #d99a61;
  --wood: #ad6335;
  --wood-dark: #71341e;
  --wood-deep: #3b180d;
  --accent: #ce7635;
  --accent-light: #ee9c5c;
  --string: #eadbc4;

  --shadow: 0 24px 55px rgba(55, 35, 20, 0.2);
  --body-w: clamp(300px, 30vw, 620px);
  --body-h: calc(var(--body-w) * 0.711);

  --neck-h: clamp(85px, 14vw, 120px);
  --neck-w: clamp(380px, 42vw, 760px);

  --head-h: calc(var(--neck-h) * 1.35);
  --head-w: clamp(100px, 8.5vw, 170px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background: var(--bg-dark);
}

body {
  min-height: 100vh;
  padding: 32px 20px;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(210, 130, 65, 0.15),
      transparent 40%
    ),
    linear-gradient(180deg, #faf6f0 0%, #e4d9cc 100%);
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.guitar-app {
  width: min(1800px, 96vw);
  margin: 0 auto;
}

.guitar-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guitar-header h1 {
  margin-bottom: 7px;
  color: #563018;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1;
}

.guitar-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.status.audio-blocked {
  border-color: #ef4444;
  color: #fca5a5;
  cursor: pointer;
  background: #3b180d;
}

.status.audio-blocked:hover {
  border-color: #f87171;
  color: #ffffff;
}

.status {
  min-width: 95px;
  padding: 9px 15px;
  border: 1px solid #49372c;
  border-radius: 999px;
  background: #1b1410;
  color: var(--accent-light);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.guitar-card {
  padding: 10px;
  border: 1px solid #cdbdae;
  border-radius: 20px;
  background: linear-gradient(145deg, #34261e, #17100c);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.guitar {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 1300px;
  min-height: 420px;
  padding: 35px 30px;
  border: 2px solid #160b06;
  border-radius: 15px;

  background:
    radial-gradient(
      ellipse at center,
      rgba(180, 95, 45, 0.16),
      transparent 65%
    ),
    #100906;
}

.guitar-head {
  position: relative;
  z-index: 10;

  width: var(--head-w);
  height: var(--head-h);

  margin-right: -3px;
  flex-shrink: 0;

  clip-path: polygon(0% 19%, 100% 0%, 100% 100%, 0% 81%);

  background: linear-gradient(145deg, #743c24, #492317 55%, #2d140c);

  box-shadow: inset 5px 0 10px rgba(255, 220, 185, 0.08);
}

.guitar-brand {
  position: absolute;
  top: 50%;
  left: 32%;
  transform: translate(-50%, -50%) rotate(-90deg);

  color: #d8b58d;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.tuning-pegs {
  position: absolute;
  top: 50%;
  right: 4%;
  width: 48%;
  height: 70%;
  transform: translateY(-50%);
}

.tuning-peg {
  position: absolute;
  width: 30%;
  height: 22%;

  border: 2px solid #665548;
  border-radius: 50%;

  background: radial-gradient(circle at 35% 30%, #e5d8c7, #968271 60%, #40332a);

  box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.5);
}

.tuning-peg:nth-child(1) {
  left: 0;
  top: 0;
}

.tuning-peg:nth-child(2) {
  right: 0;
  top: 0;
}

.tuning-peg:nth-child(3) {
  left: 35%;
  top: 0;
}

.tuning-peg:nth-child(4) {
  left: 0;
  bottom: 0;
}

.tuning-peg:nth-child(5) {
  left: 35%;
  bottom: 0;
}

.tuning-peg:nth-child(6) {
  right: 0;
  bottom: 0;
}

.guitar-viewport {
  position: relative;
  z-index: 8;

  width: var(--neck-w);
  height: var(--neck-h);

  margin-right: -3px;
  flex-shrink: 0;

  overflow: visible;
}

.guitar-neck {
  position: relative;

  width: 100%;
  height: 100%;

  border-top: 4px solid #241109;
  border-bottom: 4px solid #241109;

  background: linear-gradient(
    180deg,
    #3a2015 0%,
    #55321f 8%,
    #69412a 50%,
    #55321f 92%,
    #3a2015 100%
  );

  box-shadow:
    inset 0 5px 10px rgba(255, 220, 180, 0.07),
    inset 0 -5px 10px rgba(0, 0, 0, 0.35);
}

.frets {
  position: absolute;
  inset: 0;

  display: grid;
  grid-template-columns: repeat(13, 1fr);

  pointer-events: none;
}

.frets span {
  border-right: 3px solid #b9aa97;

  box-shadow:
    inset -1px 0 rgba(255, 255, 255, 0.25),
    2px 0 rgba(0, 0, 0, 0.35);
}

.frets span:first-child {
  border-left: 8px solid #ddcdb8;
}

.fret-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fret-marker {
  position: absolute;
  top: 50%;

  width: 6%;
  aspect-ratio: 1;

  transform: translate(-50%, -50%);

  border-radius: 50%;

  background: radial-gradient(circle at 35% 30%, #fff5e5, #d5bea0 55%, #89705a);

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.fret-marker[data-fret="3"] {
  left: 27%;
}

.fret-marker[data-fret="5"] {
  left: 42%;
}

.fret-marker[data-fret="7"] {
  left: 57%;
}

.fret-marker[data-fret="9"] {
  left: 72%;
}

.fret-marker[data-fret="12"] {
  left: 95%;
}

.fret-marker.double {
  width: 6%;
  height: 28%;

  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.fret-marker.double::before,
.fret-marker.double::after {
  content: "";

  position: absolute;
  left: 0;

  width: 100%;
  aspect-ratio: 1;

  border-radius: 50%;

  background: radial-gradient(circle at 35% 30%, #fff5e5, #d5bea0 55%, #89705a);

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.fret-marker.double::before {
  top: 0;
}

.fret-marker.double::after {
  bottom: 0;
}

.strings {
  position: absolute;
  inset: 0;

  z-index: 20;

  display: grid;
  grid-template-rows: repeat(6, 1fr);

  pointer-events: none;
}

.string {
  position: relative;

  width: 100%;
  height: 100%;

  border: 0;
  padding: 0;

  background: transparent;

  cursor: pointer;
  pointer-events: auto;
}

.string::before {
  content: "";

  position: absolute;
  left: 0;
  right: 0;
  top: 50%;

  height: var(--string-width);

  transform: translateY(-50%);

  border-radius: 999px;

  background: linear-gradient(
    180deg,
    #76685a,
    var(--string-color),
    #f7e7cf,
    #756658
  );

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.string:nth-child(1) {
  --string-width: 5px;
  --string-color: #c7b297;
}

.string:nth-child(2) {
  --string-width: 4.5px;
  --string-color: #d1bda2;
}

.string:nth-child(3) {
  --string-width: 4px;
  --string-color: #d9c6aa;
}

.string:nth-child(4) {
  --string-width: 3.5px;
  --string-color: #dfccb2;
}

.string:nth-child(5) {
  --string-width: 3px;
  --string-color: #e7d6bd;
}

.string:nth-child(6) {
  --string-width: 2.5px;
  --string-color: #efdec7;
}

.string:hover::before {
  filter: brightness(1.3);
}

.string.active::before {
  transform: translateY(-50%) scaleY(1.8);

  filter: brightness(1.6) drop-shadow(0 0 7px rgba(239, 156, 92, 0.8));
}

.string-label {
  position: absolute;
  left: 1%;
  top: 50%;

  z-index: 25;

  transform: translate(-100%, -50%);

  color: rgba(245, 225, 200, 0.9);

  font-size: 0.66rem;
  font-weight: 900;

  pointer-events: none;
}

.fret-controls {
  position: absolute;
  inset: 0;

  z-index: 12;

  display: grid;
  grid-template-columns: repeat(13, 1fr);

  pointer-events: none;
}

.fret-button {
  position: relative;

  width: 100%;
  height: 100%;

  border: 0;
  background: transparent;

  cursor: pointer;
  pointer-events: auto;
}

.fret-number {
  position: absolute;

  width: 1px;
  height: 1px;

  overflow: hidden;
  clip: rect(0, 0, 0, 0);

  white-space: nowrap;
}

.fret-button:hover {
  background: radial-gradient(
    circle,
    rgba(255, 220, 180, 0.12),
    transparent 65%
  );
}

.fret-button.selected {
  background: radial-gradient(
    circle,
    rgba(239, 156, 92, 0.18),
    transparent 65%
  );
}

.fret-button:focus-visible {
  outline: 2px solid var(--accent-light);
}

.guitar-body {
  position: relative;
  z-index: 2;

  width: var(--body-w);
  height: var(--body-h);

  flex-shrink: 0;

  overflow: visible;
}

.guitar-body-shape {
  position: absolute;
  inset: 0;

  z-index: 1;

  width: 100%;
  height: 100%;

  display: block;

  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5));
}

.sound-hole {
  position: absolute;

  top: 50%;
  left: 34%;

  z-index: 4;

  width: 33%;
  aspect-ratio: 1;

  transform: translate(-50%, -50%);

  border: 9px solid #5a2916;
  border-radius: 50%;

  background: radial-gradient(circle, #030201 0%, #0d0503 60%, #241008 100%);

  box-shadow:
    0 0 0 4px #bd7046,
    0 0 0 8px rgba(62, 24, 11, 0.75),
    inset 0 12px 20px rgba(0, 0, 0, 0.9);
}

.sound-hole-ring {
  position: absolute;
  inset: 12px;

  border: 1px solid rgba(224, 155, 106, 0.35);

  border-radius: 50%;
}

.bridge {
  position: absolute;

  left: 84%;
  top: 50%;

  z-index: 30;

  width: 7%;
  height: 36%;

  transform: translate(-50%, -50%);

  border-radius: 8px;

  background: linear-gradient(90deg, #493021, #1c0f09);

  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
}

.bridge-saddle {
  position: absolute;

  top: 10%;
  bottom: 10%;
  left: 50%;

  width: 22%;

  transform: translateX(-50%);

  border-radius: 999px;

  background: linear-gradient(180deg, #b8a083, #f2e0c6, #a89075);
}

.bridge-pins {
  position: absolute;

  top: 14%;
  bottom: 14%;
  left: 18%;

  z-index: 35;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bridge-pins span {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: radial-gradient(circle at 35% 30%, #f1e1ca, #98836b);
}

.string-overlay {
  position: absolute;
  inset: 0;

  z-index: 26;

  width: 100%;
  height: 100%;

  pointer-events: none;
  overflow: visible;
}

.string-overlay line {
  stroke-linecap: round;
  transition: filter 0.08s ease;
}

.string-overlay line.active {
  filter: brightness(1.6) drop-shadow(0 0 7px rgba(239, 156, 92, 0.8));
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 12px;
  margin-top: 18px;

  flex-wrap: wrap;
}

.strum-button {
  min-width: 58px;
  min-height: 46px;

  padding: 9px 16px;

  border: 1px solid #49382e;
  border-radius: 12px;

  background: linear-gradient(145deg, #30251f, #171310);

  color: #f3e7da;

  font-weight: 800;
  cursor: pointer;
}

.strum-button:active {
  transform: translateY(2px);
}

.note-display {
  min-width: 130px;

  padding: 9px 18px;

  border: 1px solid #cdbdae;
  border-radius: 12px;

  background: #f8f3ec;

  text-align: center;
}

.note-display strong {
  display: block;

  color: var(--accent);
  font-size: 1.25rem;
}

.note-display span {
  display: block;

  margin-top: 2px;

  color: var(--muted);
  font-size: 0.7rem;
}

.volume-control {
  display: flex;
  align-items: center;

  gap: 8px;

  color: var(--muted);

  font-size: 0.8rem;
  font-weight: 700;
}

.volume-control input {
  width: 110px;
  accent-color: var(--accent);
}

.instructions {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 14px;
  margin-top: 20px;
}

.instruction {
  padding: 17px 18px;

  border: 1px solid #44342a;
  border-radius: 15px;

  background: linear-gradient(145deg, #29201b, #17120f);
}

.instruction strong {
  display: block;

  margin-bottom: 4px;

  color: #f4e9dc;
  font-size: 0.88rem;
}

.instruction span {
  color: #9a8b7e;

  font-size: 0.82rem;
  line-height: 1.5;
}

.keyboard-hint {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;
  margin-top: 14px;

  color: var(--muted);

  font-size: 0.78rem;

  flex-wrap: wrap;
}

.keyboard-hint kbd {
  min-width: 25px;

  padding: 3px 7px;

  border: 1px solid #bcaea1;
  border-bottom-width: 2px;
  border-radius: 5px;

  background: #eee5dc;

  color: #594d44;

  font-size: 0.68rem;
  font-weight: 800;

  text-align: center;
}

@media (max-width: 760px) {
  body {
    padding: 20px 10px;
  }

  .guitar-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .guitar {
    min-width: 900px;
  }

  .instructions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  body {
    padding: 14px 7px;
  }

  .guitar-header h1 {
    font-size: 1.6rem;
  }

  .guitar-card {
    padding: 6px;
  }

  .guitar {
    min-width: 820px;
    min-height: 330px;
    padding: 25px 20px;
  }

  .string-label {
    font-size: 0.56rem;
  }

  .instructions {
    gap: 10px;
  }

  .instruction {
    padding: 13px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
