@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #00a89d;
  --midnight: #121a26;
  --surface: #1e2a3a;
  --cool-grey: #4a5d71;
  --cool-light: #8e9dae;
  --ink: #e7eff7;
  --muted: #9caec2;
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 50% -20%, #2a3d58, #121a26 70%);
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  border-inline: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.glass-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.glass-box-strong {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.topbar {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  gap: 0.8rem;
  align-items: start;
  padding: 1rem 1rem 0.25rem;
}

.topbar-spacer {
  width: 2rem;
  height: 2rem;
}

.brand-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--primary);
}

.brand-subtitle em {
  color: var(--cool-light);
  font-style: normal;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cool-light);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.preview-area {
  padding: 0.8rem 1rem 0.65rem;
}

.preview-card {
  border-radius: 2.2rem;
  padding: 1.35rem;
}

.preview-slot-wrap {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: rgba(17, 26, 39, 0.55);
}

#previewCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 0;
}

.slot-hint {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  border-radius: 1rem;
  border: 2px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--cool-light);
  text-align: center;
  padding: 0.5rem;
  transition: all 0.2s ease;
}

.slot-hint.top {
  top: 0.5rem;
  height: calc(50% - 0.55rem);
}

.slot-hint.bottom {
  bottom: 0.5rem;
  height: calc(50% - 0.55rem);
}

.slot-hint p {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.slot-hint small {
  font-size: 0.67rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

.slot-hint.dragover {
  border-color: var(--primary);
  background: rgba(0, 168, 157, 0.14);
}

.slot-hint .slot-remove-btn {
  display: none;
}

.slot-hint.has-image {
  border: none;
  background: transparent;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0.45rem;
}

.slot-hint.has-image p,
.slot-hint.has-image small {
  display: none;
}

.slot-hint.has-image .slot-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(18, 26, 38, 0.85);
  color: #e4edf6;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  z-index: 2;
}

.slot-hint input[type='file'] {
  display: none;
}

.status {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.status.error {
  color: #ff8181;
}

.status.ok {
  color: #4ee0b0;
}

.frame-quick {
  margin: 0 1rem 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
}

.frame-quick label {
  margin: 0;
}

.frame-quick .reset-inline {
  margin-top: 0.45rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin: 0 1rem 0.9rem;
  padding: 0.35rem;
  border-radius: 999px;
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 0.35rem;
  background: transparent;
  color: var(--cool-light);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.tab.is-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 168, 157, 0.28);
}

.panels {
  flex: 1;
  overflow: auto;
  padding: 0 1rem 10.3rem;
}

.panel {
  display: none;
  border-radius: 2rem;
  padding: 1.05rem;
  margin-bottom: 1rem;
}

.panel.is-active {
  display: block;
}

.panel h2 {
  margin: 0 0 0.95rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--cool-light);
  font-weight: 900;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  color: #dbe8f5;
  font-size: 0.9rem;
  font-weight: 600;
}

.value-pill {
  float: right;
  font-size: 0.63rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--primary);
  background: rgba(0, 168, 157, 0.16);
  padding: 0.22rem 0.46rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 168, 157, 0.25);
}

input[type='range'] {
  width: 100%;
  margin-top: 0.55rem;
  margin-bottom: 0.25rem;
  appearance: none;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(8, 15, 24, 0.6);
  accent-color: var(--primary);
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  border: 2px solid #1e2a3a;
  box-shadow: 0 0 16px rgba(0, 168, 157, 0.45);
}

input[type='color'] {
  width: 100%;
  height: 2.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 18, 28, 0.6);
}

select {
  width: 100%;
  margin-top: 0.55rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 18, 28, 0.6);
  color: #dbe8f5;
  padding: 0 0.6rem;
}
.photo-controls {
  display: grid;
  gap: 0.85rem;
}

.row {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.row-head span {
  color: #dbe7f3;
}

button {
  border: 0;
  border-radius: 0.9rem;
  font-weight: 700;
  color: white;
}

.ghost-btn,
.reset-inline,
.block-reset,
.secondary {
  background: rgba(72, 92, 117, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d4e1ef;
  padding: 0.45rem 0.7rem;
  font-size: 0.73rem;
  margin-bottom: 0.75rem;
}

.reset-inline {
  margin-top: -0.1rem;
}

.footer-export {
  position: fixed;
  left: 50%;
  bottom: 0.95rem;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 428px;
  border-radius: 1.6rem;
  padding: 0.8rem;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 0.65rem;
  align-items: end;
  z-index: 25;
}

.quality-wrap label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.15rem;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cool-light);
  font-weight: 900;
}

.quality-wrap #qualityValue {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

#exportBtn {
  height: 2.8rem;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #08b6aa, #00a89d);
  box-shadow: 0 10px 26px rgba(0, 168, 157, 0.35);
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

#exportBtn:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.credit {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.67rem;
  color: var(--cool-light);
}

.credit a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.credit a:hover {
  text-decoration: underline;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.help-modal[hidden] {
  display: none;
}

.help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 20, 0.75);
}

.help-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 82dvh;
  overflow: auto;
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(22, 36, 55, 0.96);
}

.help-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.help-dialog h2 {
  margin: 0;
  font-size: 1rem;
}

.help-content {
  padding: 0.9rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.help-content p {
  margin: 0 0 0.6rem;
}

.help-content ol {
  margin: 0.1rem 0 0.75rem 1.1rem;
  padding: 0;
}

@media (max-width: 370px) {
  .brand-title {
    font-size: 0.95rem;
  }

  .tab {
    font-size: 0.66rem;
  }
}




