body {
  font-family: Calibri, Arial, sans-serif;
  background: #f4f4f4;
  margin: 0;
  padding: 20px;
}
h1 {
  text-align: center;
  font-size: 2rem;
  margin-top: 24px;
}
#ticker {
  background: #222;
  color: #0f0;
  padding: 10px 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  font-family: monospace;
}
#ticker-content {
  display: inline-block;
  white-space: nowrap;
  animation: scroll-left 30s linear infinite;
}
#ticker:hover #ticker-content {
  animation-play-state: paused;
}
@keyframes scroll-left {
  0% { transform: translateX(100%) }
  100% { transform: translateX(-100%) }
}
.price-up { color: #00e676; }
.price-down { color: #ff4c4c; }
.arrow { font-size: 14px; margin-left: 4px; }

#status-bar {
  margin: 58px auto 18px auto;
  padding: 8px 18px;
  max-width: 900px;
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: flex-start;
  box-shadow: 0 1px 8px rgba(0,0,0,0.08);
  font-size: 1.08rem;
}
.mini-btn {
  font-size: 0.9em;
  font-family: Calibri;
  padding: 3px 10px;
  margin-left: 7px;
  border-radius: 8px;
  border: none;
  background: #ececec;
  color: #007acc;
  cursor: pointer;
  transition: background 0.15s;
}
.mini-btn:hover {
  background: #d7eaff;
}

#current-time {
  font-weight: bold;
  color: #007acc;
}
#ws-status {
  margin-left: 12px;
  display: flex;
  align-items: center;
  font-weight: 500;
}
.ws-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #bbb;
  margin-right: 6px;
  box-shadow: 0 0 6px #2222;
  animation: blink 2s infinite;
}
.ws-dot.connected {
  background: #39e639;
  animation: blink-green 1s infinite;
}
.ws-dot.disconnected {
  background: #ff5252;
  animation: blink-red 2s infinite;
}
@keyframes blink-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes blink-red {
  0%, 100% { opacity: 1; }
  60% { opacity: 0.35; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Table styling */
.table-responsive { overflow-x: auto; margin-top: 12px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.07);
  min-width: 900px;
}
th, td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  font-size: 1rem;
}
th {
  background: #007acc;
  color: white;
  cursor: pointer;
  user-select: none;
  position: relative;
}
th.sorted-asc::after {
  content: ' ▲';
  font-size: 0.9em;
}
th.sorted-desc::after {
  content: ' ▼';
  font-size: 0.9em;
}
tr.active    { background-color: #f4fbf4; }
tr.win       { background-color: #d0f8ce; }
tr.loss      { background-color: #ffd6d6; }
tr.expired   { background-color: #ffe6b3; }
tr:hover     { background: #f2faff; }

@media (max-width: 800px) {
  #ticker { font-size: 0.95em; }
  #status-bar { font-size: 0.92rem; max-width: 99vw; }
  table { font-size: 0.92em; min-width: 700px; }
  th, td { padding: 8px 5px; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.2rem; }
  #ticker { font-size: 0.85em; }
  #status-bar { font-size: 0.83rem; padding: 7px 3vw;}
  table { font-size: 0.85em; min-width: 420px; }
  th, td { padding: 6px 2px; }
}
