:root {
  --app-bg: #1e1f22;
  --panel: #232428;
  --panel-soft: #2b2d31;
  --panel-elevated: #313338;
  --line: #3f4147;
  --text: #dbdee1;
  --muted: #a7abb2;
  --discord-green: #3ba55d;
  --discord-red: #ed4245;
  --discord-blue: #5865f2;
  --discord-gold: #f0b232;
  --button-primary: #5865f2;
  --button-primary-hover: #4752c4;
  --button-secondary: #4e5058;
  --button-danger: #da373c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background: var(--app-bg);
  color: var(--text);
  font-family: "gg sans", "Noto Sans", "Segoe UI", sans-serif;
  overflow: hidden;
}

.demo-layout {
  height: 100vh;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  padding: 14px;
  overflow: hidden;
}

.status-panel,
.chat-panel {
  border: 1px solid #1a1b1e;
  border-radius: 10px;
  background: var(--panel);
}

.status-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-panel h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.subhead {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.wallet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.wallet-line {
  margin: 6px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.wallet-line span {
  color: var(--muted);
}

.rate-status {
  min-height: 1.2rem;
  margin: 0;
  color: #f3a764;
  font-size: 0.92rem;
}

.ghost-btn {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  cursor: pointer;
}

.ghost-btn:hover {
  background: #3a3c43;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: var(--panel-elevated);
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  border-bottom: 1px solid #25262b;
  padding: 12px 16px;
}

.chat-header h2 {
  margin: 0;
  font-size: 1rem;
}

.chat-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-log {
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
}

.chat-entry.user {
  grid-template-columns: 44px minmax(0, 1fr);
}

.chat-entry.system {
  display: block;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-top: 1px;
}

.entry-main {
  min-width: 0;
}

.entry-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.author-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f2f3f5;
}

.bot-tag {
  border-radius: 5px;
  padding: 5px 7px 3px;
  background: var(--discord-blue);
  color: #ffffff;
  font-size: 0.83rem;
  font-weight: 700;
}

.message-time {
  color: var(--muted);
  font-size: 0.95rem;
}

.entry-content {
  min-width: 0;
}

.message-text {
  margin: 0;
  line-height: 1.35;
  white-space: pre-wrap;
}

.user .message-text {
  color: #dcddde;
}

.system-note {
  width: fit-content;
  margin: 0 auto;
  padding: 6px 11px;
  border: 1px solid #4d3a24;
  border-radius: 999px;
  background: #403024;
  color: #f4c58d;
  font-size: 0.84rem;
}

.typing-wrap {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.typing-wrap span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8ccd4;
  animation: typing 1s infinite ease-in-out;
}

.typing-wrap span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-wrap span:nth-child(3) {
  animation-delay: 0.28s;
}

.discord-embed {
  margin-top: 8px;
  border: 1px solid #4f545c;
  border-left: 5px solid var(--embed-color, var(--discord-blue));
  border-radius: 6px;
  background: #2f3136;
  overflow: hidden;
}

.embed-body {
  padding: 12px 14px 10px;
}

.embed-title {
  margin: 0;
  color: #ffffff;
  font-size: 1.04rem;
  font-weight: 700;
}

.embed-description {
  margin-top: 10px;
  color: #dcddde;
  line-height: 1.34;
}

.embed-line {
  margin: 0;
}

.embed-fields {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.embed-field {
  margin: 0;
  display: grid;
  gap: 2px;
}

.embed-field-name {
  margin: 0;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.2;
}

.embed-field-value {
  margin: 0;
  color: #dbdee1;
  white-space: pre-wrap;
  font-size: 0.93rem;
  line-height: 1.25;
}

.embed-inline-code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  background: #1f2024;
  border: 1px solid #3f424a;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 0.85em;
}

.embed-image {
  margin-top: 12px;
}

.embed-image img {
  display: block;
  width: 100%;
  max-width: 620px;
  border-radius: 6px;
}

.embed-footer {
  margin-top: 11px;
  color: #c4c7cc;
  font-size: 0.88rem;
}

.table-attachment {
  width: 100%;
  max-width: 620px;
  border-radius: 6px;
  background: #5e3b1a;
  padding: 12px;
}

.table-felt {
  border-radius: 999px;
  border: 10px solid #8d6037;
  background: radial-gradient(
    circle at 35% 30%,
    #19b851,
    #14a348 38%,
    #0f8f40 100%
  );
  min-height: 240px;
  padding: 18px;
  position: relative;
}

.table-felt::after {
  content: "";
  position: absolute;
  inset: 22% 11%;
  border: 3px solid rgba(196, 211, 68, 0.65);
  border-radius: 999px;
  pointer-events: none;
}

.hand-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.hand-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hand-row.active {
  outline: 3px solid #ffd24b;
  border-radius: 8px;
  background: rgba(255, 210, 75, 0.12);
  padding: 6px;
}

.playing-card {
  width: 70px;
  height: 98px;
  border-radius: 6px;
  background: #f2f3f5;
  border: 1px solid #bcc2ca;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 5px;
  font-weight: 700;
}

.playing-card.red {
  color: #d92b2f;
}

.playing-card.black {
  color: #17191c;
}

.playing-card.back {
  border: 1px solid #822a31;
  background: repeating-linear-gradient(
    45deg,
    #b63f49,
    #b63f49 5px,
    #d76672 5px,
    #d76672 10px
  );
  color: transparent;
}

.card-corner {
  font-size: 0.87rem;
  line-height: 1;
}

.card-center {
  font-size: 1.6rem;
  text-align: center;
  align-self: center;
}

.card-corner.bottom {
  transform: rotate(180deg);
  justify-self: end;
  text-align: right;
}

.action-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discord-btn {
  border: 0;
  border-radius: 6px;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 12px;
  cursor: pointer;
}

.discord-btn.primary {
  background: var(--button-primary);
}

.discord-btn.primary:hover {
  background: var(--button-primary-hover);
}

.discord-btn.secondary {
  background: var(--button-secondary);
}

.discord-btn.secondary:hover {
  background: #5d6069;
}

.discord-btn.danger {
  background: var(--button-danger);
}

.discord-btn.danger:hover {
  background: #bc2f33;
}

.discord-btn:disabled,
.quick-btn:disabled,
.ghost-btn:disabled,
.composer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quick-actions {
  padding: 12px 14px;
  border-top: 1px solid #26272c;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-btn {
  border: 1px solid #4a4d55;
  border-radius: 999px;
  background: #3d4048;
  color: #ffffff;
  padding: 6px 11px;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.quick-btn:hover {
  background: #4a4e58;
}

.composer {
  border-top: 1px solid #26272c;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 13px 14px;
}

.composer input,
.composer button {
  border-radius: 8px;
  font: inherit;
}

.composer input {
  border: 1px solid #1f2023;
  background: #1e1f22;
  color: #f2f3f5;
  padding: 10px 11px;
}

.composer input:focus {
  outline: none;
  border-color: #4e5d94;
}

.composer button {
  border: 0;
  background: var(--button-primary);
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
}

.composer button:hover {
  background: var(--button-primary-hover);
}

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (max-width: 1000px) {
  .demo-layout {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .chat-panel {
    min-height: 0;
  }

  .table-felt {
    min-height: 190px;
    border-width: 8px;
    padding: 12px;
  }

  .playing-card {
    width: 58px;
    height: 82px;
  }
}

@media (min-width: 1100px) and (orientation: landscape) {
  .avatar {
    width: 46px;
    height: 46px;
  }
}
