
:root{
  --paper: #F6F1E7;
  --paper-line: #E4DBC8;
  --ink: #241F1C;
  --ink-soft: #6b6259;
  --rule: #D8CFC0;
  --accent: #C1443D;
  --accent-soft: #EFDCC9;
  --key: #FFFDF8;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  min-height:100vh;
  display:flex;
  justify-content:center;
  padding: 32px 16px;
}

.sheet{
  width:100%;
  max-width: 780px;
  background: var(--key);
  border: 1px solid var(--rule);
  box-shadow: 6px 6px 0 var(--accent-soft);
  position:relative;
  padding: 28px 24px 24px 56px;
}

.home-link{
  display:inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.home-link:hover{ text-decoration: underline; }

.sheet::before{
  content:"";
  position:absolute;
  left:36px; top:0; bottom:0;
  width:2px;
  background: var(--accent);
  opacity:0.55;
}

header{
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 16px;
}

h1{
  margin:0 0 6px 0;
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: 0.5px;
  font-weight: 700;
}

header p{
  margin:0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* --- Style deck: font / color / effect controls --- */
.style-deck{
  display:flex;
  flex-wrap:wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.style-field{
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
  flex: 1 1 160px;
}

.style-field select,
.style-field input[type="color"]{
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--key);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 7px 8px;
  cursor:pointer;
}

.style-field input[type="color"]{
  height: 34px;
  padding: 3px;
}

.style-field select:focus,
.style-field input[type="color"]:focus{
  outline: none;
  border-color: var(--accent);
}

/* --- Toolbar --- */
.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom: 16px;
}

.key{
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom: 3px solid var(--rule);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  font-size: 12.5px;
  padding: 9px 12px;
  cursor:pointer;
  border-radius: 3px;
  transition: transform 0.08s ease, border-color 0.15s ease;
}

.key:hover{ border-color: var(--accent); }

.key:active{
  transform: translateY(2px);
  border-bottom-width: 1px;
}

.key.danger{ color: var(--accent); }

/* --- Editor --- */
textarea{
  width:100%;
  min-height: 260px;
  resize: vertical;
  font-size: 17px;
  line-height: 1.8;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent calc(1.8em - 1px),
      var(--paper-line) calc(1.8em)
    );
  background-attachment: local;
  border: 1px solid var(--rule);
  padding: 10px 12px;
  outline:none;
}

textarea:focus{ border-color: var(--accent); }

/* --- Text effect classes (applied via JS alongside inline color) --- */
.fx-shadow2d{ text-shadow: 3px 3px 6px rgba(0,0,0,0.35); }

.fx-neon{ text-shadow: 0 0 4px currentColor, 0 0 10px currentColor, 0 0 22px currentColor, 0 0 40px currentColor; }

.fx-extrude3d{
  text-shadow:
    1px 1px 0 rgba(0,0,0,0.55),
    2px 2px 0 rgba(0,0,0,0.45),
    3px 3px 0 rgba(0,0,0,0.35),
    4px 4px 0 rgba(0,0,0,0.25),
    5px 5px 6px rgba(0,0,0,0.35);
}

.fx-outline{
  -webkit-text-stroke: 1.5px currentColor;
  color: transparent;
}

.fx-emboss{
  text-shadow: 1px 1px 0 rgba(255,255,255,0.75), -1px -1px 0 rgba(0,0,0,0.45);
}

/* --- Footer --- */
.footer-row{
  margin-top: 14px;
  display:flex;
  flex-wrap:wrap;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
}

.seo-copy{
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.seo-copy h2{
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
}

.seo-copy p{ margin: 0; }

.stats{
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
}

.stats span{ color: var(--ink); font-weight:700; }

.actions{
  display:flex;
  flex-wrap: wrap;
  gap:8px;
}

.btn-solid{
  background: var(--accent);
  color: var(--key);
  border: none;
  font-family: 'Space Mono', monospace;
  font-size: 12.5px;
  padding: 9px 14px;
  cursor:pointer;
  border-radius: 3px;
}

.btn-solid:hover{ opacity:0.9; }

.btn-ghost{
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  font-family: 'Space Mono', monospace;
  font-size: 12.5px;
  padding: 9px 14px;
  cursor:pointer;
  border-radius: 3px;
}

.btn-ghost:hover{ border-color: var(--accent); color: var(--accent); }

/* --- Toast --- */
.toast{
  position: fixed;
  bottom: 20px;
  left:50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Mono', monospace;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 4px;
  opacity:0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events:none;
}

.toast.show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px){
  .sheet{ padding: 22px 16px 20px 40px; }
  .sheet::before{ left:22px; }
  .style-deck{ flex-direction: column; }
  .footer-row{ flex-direction:column; align-items:flex-start; }
  .actions{ width:100%; }
  .actions button{ flex:1; }
}

