body {
  background: #1e1e1e;
  color: #eee;
  font-family: Arial, sans-serif;
  margin: 0; padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  box-sizing: border-box;
}
.container {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 300px;
}

.editor-container {
  position: relative;
  flex: 1;
}

textarea {
  width: 100%;
  height: 100%;
  background: #2b2b2b;
  color: #fff;
  font-size: 14px;
  padding: 10px;
  resize: none;
  border: none;
  font-family: 'Press Start 2P', monospace;
  box-sizing: border-box;
  overflow-y: auto;

  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
}

.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #333;
  border: 2px solid #666;
  color: #eee;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 3px;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10;
}
.copy-btn:hover {
  background: #555;
  border-color: #aaa;
}

#preview {
  flex: 1;
  background: #2b2b2b;
  border-left: 2px solid #444;
  padding: 10px;
  font-family: 'Press Start 2P', monospace;
  white-space: pre-wrap;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 300px;
  word-break: break-word;
}

.buttons {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.buttons.formatting {
  margin-top: 15px;
}
button {
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  border: 2px solid #ccc;
  background: #222;
  color: inherit;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 0 4px #444;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
button:hover {
  background: #333;
  border-color: #fff;
  box-shadow: inset 0 0 6px #aaa;
}
button:active {
  background: #111;
  box-shadow: inset 0 0 2px #000;
  border-color: #888;
}

.color-0 { color: #000000; }
.color-1 { color: #0000AA; }
.color-2 { color: #00AA00; }
.color-3 { color: #00AAAA; }
.color-4 { color: #AA0000; }
.color-5 { color: #AA00AA; }
.color-6 { color: #FFAA00; }
.color-7 { color: #AAAAAA; }
.color-8 { color: #555555; }
.color-9 { color: #5555FF; }
.color-a { color: #55FF55; }
.color-b { color: #55FFFF; }
.color-c { color: #FF5555; }
.color-d { color: #FF55FF; }
.color-e { color: #FFFF55; }
.color-f { color: #FFFFFF; }
.color-g { color: #FFCC00; }

.bold { font-weight: bold; }
.italic { font-style: italic; }
.underline { text-decoration: underline; }
.strikethrough { text-decoration: line-through; }

#editor, #preview {
  letter-spacing: 0.05em;
}

@media screen and (orientation: portrait) {
	
	
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px;
    background: #1e1e1e;
    min-height: 100vh;
    box-sizing: border-box;
  }

  .container {
    display: flex;
    flex-direction: column;
    width: 95vw;
    max-width: 500px;
    gap: 10px;
    flex: 1;
  }
  

  .editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#preview {
  flex: 1;
  display: block;
  min-height: 150px;
  max-height: 60vh;
  background: #2b2b2b;
  border: 2px solid #444;
  box-sizing: border-box;
  overflow-y: auto; 
  overflow-x: hidden;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}



  .copy-btn {
    font-size: 10px;
    padding: 3px 6px;
    top: 8px;
    right: 8px;
  }

  .buttons {
    width: 95vw;
    max-width: 500px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    margin-bottom: 20px;
  }

  button {
    font-size: 10px;
    height: 26px;
    min-width: 35px;
    padding: 3px 6px;
  }
}
