@font-face {
  font-family: "Splatoon2";
  src: url("../fonts/Splatoon2.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "InklingScript";
  src: url("../fonts/InklingV2.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "OctolingA";
  src: url("../fonts/Octoling15a.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "OctolingB";
  src: url("../fonts/Octoling15b.ttf") format("truetype");
  font-display: swap;
}
:root {
  --bg: #16161f;
  --bg-card: #21212e;
  --bg-input: #2a2a3a;
  --ink-orange: #ff6a1a;
  --ink-blue: #4f6bff;
  --ink-cyan: #21d5e0;
  --text: #f2f2f5;
  --text-dim: #9b9bab;
  --border: #3a3a4e;
  --radius: 14px;
  font-size: 16px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.16' fill='%23ff6a1a'><circle cx='100' cy='100' r='52'/><circle cx='148' cy='76' r='20'/><circle cx='62' cy='64' r='18'/><circle cx='132' cy='142' r='22'/><circle cx='58' cy='138' r='14'/><ellipse cx='100' cy='38' rx='10' ry='24'/><ellipse cx='170' cy='112' rx='20' ry='9'/><circle cx='178' cy='42' r='7'/><circle cx='26' cy='96' r='8'/><circle cx='150' cy='178' r='6'/><circle cx='38' cy='176' r='5'/></g></svg>") no-repeat left -70px top 6% / 380px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.15' fill='%234f6bff'><circle cx='104' cy='96' r='50'/><circle cx='56' cy='120' r='22'/><circle cx='150' cy='128' r='18'/><circle cx='128' cy='52' r='20'/><circle cx='66' cy='56' r='12'/><ellipse cx='178' cy='84' rx='16' ry='8'/><ellipse cx='96' cy='168' rx='9' ry='20'/><circle cx='30' cy='58' r='6'/><circle cx='184' cy='160' r='7'/><circle cx='22' cy='168' r='8'/><circle cx='160' cy='22' r='5'/></g></svg>") no-repeat right -90px top 30% / 440px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.14' fill='%23ff6a1a'><circle cx='96' cy='104' r='44'/><circle cx='140' cy='70' r='18'/><circle cx='54' cy='76' r='15'/><ellipse cx='150' cy='146' rx='18' ry='10'/><circle cx='44' cy='148' r='11'/><circle cx='178' cy='106' r='7'/><circle cx='98' cy='26' r='8'/><circle cx='24' cy='110' r='6'/></g></svg>") no-repeat 88% 92% / 250px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.14' fill='%234f6bff'><circle cx='100' cy='98' r='46'/><circle cx='146' cy='124' r='19'/><circle cx='58' cy='62' r='16'/><ellipse cx='52' cy='140' rx='17' ry='9'/><ellipse cx='124' cy='34' rx='8' ry='18'/><circle cx='176' cy='62' r='7'/><circle cx='28' cy='92' r='7'/><circle cx='162' cy='180' r='6'/></g></svg>") no-repeat 6% 82% / 280px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.13' fill='%234f6bff'><circle cx='98' cy='102' r='40'/><circle cx='136' cy='66' r='17'/><circle cx='60' cy='130' r='15'/><ellipse cx='160' cy='140' rx='15' ry='8'/><circle cx='42' cy='66' r='10'/><circle cx='178' cy='92' r='6'/><circle cx='96' cy='30' r='7'/></g></svg>") no-repeat 38% -60px / 230px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.13' fill='%23ff6a1a'><circle cx='102' cy='96' r='42'/><circle cx='62' cy='128' r='18'/><circle cx='142' cy='130' r='14'/><ellipse cx='148' cy='52' rx='16' ry='9'/><ellipse cx='44' cy='62' rx='8' ry='16'/><circle cx='180' cy='110' r='6'/><circle cx='104' cy='176' r='8'/><circle cx='22' cy='124' r='5'/></g></svg>") no-repeat 72% 102% / 240px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.12' fill='%23ff6a1a'><circle cx='96' cy='100' r='38'/><circle cx='134' cy='72' r='15'/><circle cx='58' cy='74' r='12'/><ellipse cx='140' cy='142' rx='14' ry='8'/><circle cx='48' cy='142' r='9'/><circle cx='170' cy='44' r='6'/><circle cx='28' cy='52' r='5'/></g></svg>") no-repeat right -40px top -50px / 210px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.12' fill='%234f6bff'><circle cx='100' cy='96' r='36'/><circle cx='140' cy='120' r='14'/><circle cx='64' cy='66' r='13'/><ellipse cx='54' cy='134' rx='14' ry='8'/><circle cx='170' cy='70' r='6'/><circle cx='98' cy='168' r='7'/></g></svg>") no-repeat left -50px bottom -60px / 220px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.11' fill='%23ff6a1a'><circle cx='100' cy='100' r='30'/><circle cx='130' cy='76' r='12'/><ellipse cx='66' cy='124' rx='12' ry='7'/><circle cx='66' cy='70' r='8'/><circle cx='150' cy='130' r='6'/></g></svg>") no-repeat 16% 38% / 150px fixed,
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g opacity='.11' fill='%234f6bff'><circle cx='100' cy='100' r='30'/><circle cx='72' cy='130' r='11'/><ellipse cx='138' cy='70' rx='13' ry='7'/><circle cx='136' cy='136' r='7'/><circle cx='58' cy='66' r='6'/></g></svg>") no-repeat 86% 56% / 160px fixed,
    radial-gradient(circle at 12% 8%, rgba(255, 106, 26, 0.14), transparent 38%) fixed,
    radial-gradient(circle at 88% 92%, rgba(79, 107, 255, 0.12), transparent 42%) fixed,
    radial-gradient(circle at 80% 12%, rgba(33, 213, 224, 0.08), transparent 35%) fixed,
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  text-align: center;
  padding: 2.2rem 1rem 1.4rem;
}
.logo {
  font-family: "Splatoon2", "Segoe UI", sans-serif;
  font-size: 2.6rem;
  letter-spacing: 1px;
}
.logo-splat { color: var(--ink-orange); }
.logo-translate { color: var(--ink-blue); }
.translator {
  width: min(1060px, 94vw);
  margin: 0 auto;
  flex: 1;
}
.lang-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.lang-select {
  flex: 1;
  max-width: 330px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.lang-select:hover,
.lang-select:focus { border-color: var(--ink-orange); }
.lang-select optgroup {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--text-dim);
  background: var(--bg-card);
}
.lang-select option {
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-card);
}
.lang-select option.conlang-option {
  font-family: "Splatoon2", "Segoe UI", sans-serif;
  font-size: 1.05rem;
}
.lang-select.conlang-selected {
  font-family: "Splatoon2", "Segoe UI", sans-serif;
}
.swap-btn {
  background: var(--bg-card);
  color: var(--ink-blue);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.7rem;
  height: 2.7rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.15s;
}
.swap-btn:hover {
  border-color: var(--ink-blue);
  transform: rotate(180deg);
}
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  overflow: hidden;
}
.panel-source { border-top: 3px solid var(--ink-orange); }
.panel-target { border-top: 3px solid var(--ink-blue); }
#source-text {
  flex: 1;
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.55;
  padding: 1.1rem 1.2rem;
  font-family: inherit;
}
#source-text::placeholder { color: var(--text-dim); }
.output {
  flex: 1;
  font-size: 1.25rem;
  line-height: 1.55;
  padding: 1.1rem 1.2rem;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-y: auto;
}
.output .placeholder { color: var(--text-dim); }
.font-inkling {
  font-family: "InklingScript", "Splatoon2", sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.05em;
}
.font-octoling {
  font-family: "OctolingA", "OctolingB", "Splatoon2", sans-serif;
  text-transform: lowercase;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}
.latin-half {
  flex: 1;
  border-top: 1px dashed var(--border);
  padding: 1.1rem 1.2rem;
  font-family: "Splatoon2", "Segoe UI", sans-serif;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-cyan);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  min-height: 5rem;
}
.latin-half:empty::before {
  content: "Romanized";
  color: var(--text-dim);
  font-family: "Splatoon2", "Segoe UI", sans-serif;
  font-size: 1rem;
  letter-spacing: normal;
}
#source-latin:empty::before { content: "Original script"; }
.latin-half.font-inkling {
  font-family: "InklingScript", "Splatoon2", sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.05em;
}
.latin-half.font-octoling {
  font-family: "OctolingA", "OctolingB", "Splatoon2", sans-serif;
  text-transform: lowercase;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}
#source-text::placeholder {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 1.25rem;
  letter-spacing: normal;
}
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.9rem;
  border-top: 1px solid var(--border);
  min-height: 2.6rem;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--bg-input);
}
.char-count,
.status {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.status.error { color: var(--ink-orange); }
.status.ok { color: var(--ink-blue); }
.footer {
  margin-top: 2.5rem;
  padding: 1.4rem 1rem 2rem;
  text-align: center;
}
.made-by {
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer a { color: #18929e; }
.credits-btn {
  margin-left: 0.7rem;
  vertical-align: middle;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.credits-btn:hover {
  color: var(--text);
  border-color: var(--ink-orange);
}
.version {
  margin-left: 0.7rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  vertical-align: middle;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--ink-orange);
  border-radius: var(--radius);
  max-width: 620px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.6rem 1.8rem;
}
.modal h2 {
  font-family: "Splatoon2", "Segoe UI", sans-serif;
  color: var(--ink-blue);
  margin-bottom: 0.9rem;
  font-size: 1.4rem;
}
.modal p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}
.modal a { color: var(--ink-cyan); }
.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover {
  color: var(--text);
  background: var(--bg-input);
}
@media (max-width: 720px) {
  .panels { grid-template-columns: 1fr; }
  .logo { font-size: 2rem; }
  .lang-bar { flex-wrap: nowrap; }
  .lang-select { min-width: 0; }
}
