body {
  background: #f7f7f7;
  color: #222;
  font-family: 'Space Mono', monospace;
  margin: 0;
  padding: 0;
}
#main-wrap {
  max-width: 900px;
  margin: 32px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 32px 0 #1112, 0 0 0 8px #e0e0e0 inset;
  overflow: hidden;
}
header {
  background: #fff;
  border-bottom: 2px solid #ffe600;
  padding: 18px 36px 10px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h1 {
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.07em;
  font-size: 2.2em;
  color: #222;
}
#mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
#mode-toggle button {
  background: #ececec;
  border: none;
  border-radius: 12px 12px 0 0;
  margin-left: 2px;
  font-family: inherit;
  font-size: 1em;
  padding: 8px 20px 6px 20px;
  color: #888;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, color 0.15s;
}
#mode-toggle .active {
  background: #ffe600;
  color: #111;
  font-weight: bold;
}
main {
  padding: 36px;
  background: #f7f7f7;
}
section {
  margin-bottom: 40px;
}
.input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.label {
  font-weight: bold;
  color: #222;
  margin-right: 5px;
}
.mono {
  font-family: "Space Mono", monospace;
  font-size: 1.09em;
  color: #444;
  margin-right: 7px;
  word-break: break-all;
  user-select: all;
}
.copy-status {
  color: #2a5;
  font-size: 0.95em;
  min-width: 50px;
}
.btn {
  background: #ececec;
  color: #222;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-family: inherit;
  padding: 7px 16px;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 7px;
  transition: background 0.15s;
}
.btn:active, .btn:focus {
  background: #ffe600;
  color: #222;
  outline: none;
}
#piano-wrap {
  margin-bottom: 18px;
  position: relative;
  user-select: none;
}
.piano {
  display: flex;
  position: relative;
  height: 120px;
  margin-bottom: 16px;
  user-select: none;
}
.piano-key {
  border-radius: 6px;
  margin-right: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.93em;
  box-shadow: 0 2px 4px #aaa2;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: transform 0.11s;
}
.piano-key.white {
  width: 36px;
  height: 110px;
  background: #fff;
  border: 1px solid #ffe600;
  color: #222;
}
.piano-key.black {
  width: 22px;
  height: 72px;
  background: #1a1a1a;
  color: #ffe600;
  position: absolute;
  z-index: 2;
  margin-left: -11px;
  border: 1.5px solid #ffe600;
  top: 0;
}
.piano-key.active {
  background: #ffe600 !important;
  color: #222 !important;
  transform: scale(1.1);
}
.piano-key .key-note {
  font-size: 0.8em;
  color: #999;
}
#octave-indicator {
  margin: 8px 0 0 0;
  font-weight: bold;
  font-size: 1.1em;
  color: #888;
}
#melody-bar {
  min-height: 24px;
  margin-bottom: 12px;
}
.melody-note {
  display: inline-block;
  background: #ffe600;
  color: #111;
  font-family: inherit;
  font-size: 1em;
  padding: 2px 10px;
  border-radius: 7px;
  margin-right: 2px;
  margin-bottom: 2px;
  transition: background 0.14s, color 0.14s;
}
.melody-note.playing {
  background: #222;
  color: #ffe600;
}
#led-grid-wrap {
  display: flex;
  justify-content: center;
  margin: 0.6em 0 1em 0;
}
.led-grid {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  grid-template-rows: repeat(5, 36px);
  gap: 7px;
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 1px 7px #ffe60044;
  border: 2px solid #ffe600;
  width: max-content;
}
.led-cell {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: #ececec;
  border: 1.5px solid #ffe600;
  box-shadow: 0 0 4px #ffe60044 inset;
  cursor: pointer;
  transition: background 0.18s, border-color 0.19s;
  position: relative;
  z-index: 1;
}
.led-cell.on {
  background: #ffe600;
  border-color: #222;
  box-shadow: 0 0 12px #ffe60077, 0 0 7px #ffe60044 inset;
}
.led-cell.anim {
  animation: led-blink 0.4s;
  /* Will have background color set inline from JS */
}
@keyframes led-blink {
  0% { filter: brightness(1.0);}
  50% { filter: brightness(2.2);}
  100% { filter: brightness(1.0);}
}
.hide { display: none !important; }
#decode-out, #encode-out, #cipher-output {
  font-size: 1.12em;
  color: #222;
  margin-top: 0.4em;
}
.body-zoomed {
  font-size: 1.5em !important;
}
