* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #E8E8E8;
    color: #3A4B7C;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace {
    width: 800px;
    min-height: 70vh;
    background: #E8E8E8;
    border-radius: 0;
    box-shadow: none;
    padding: 28px 32px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: #3A4B7C;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Bottom panel with two columns */
.bottom-panel {
    width: 100%;
    margin-top: 20px;
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.bottom-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Account panel */
.account-panel {
    width: 100%;
    padding: 12px 14px;
    background: #FFFFFF;
    border: none;
    border-radius: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.account-title { font-weight: 800; color: #3A4B7C; margin-bottom: 6px; font-size: 14px; }
.account-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-top: 1px solid #E8E8E8;
}
.account-row:first-of-type { border-top: none; }
.account-row .label { color: #3A4B7C; font-size: 13px; font-weight: 600; }
.account-row .value { 
    color: #3A4B7C; 
    font-weight: 700; 
    font-size: 13px; 
    text-align: right;
    word-break: break-all;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dial-wrapper { display: flex; align-items: center; justify-content: center; position: relative; }
/* Stats panel */
.stats-panel {
    width: 100%;
    padding: 16px 20px;
    background: #FFFFFF;
    border: none;
    border-radius: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.stats-row { display: flex; justify-content: space-between; padding: 4px 0; }
.stats-row .label { color: #3A4B7C; font-size: 13px; font-weight: 600; }
.stats-row .value { color: #3A4B7C; font-weight: 700; font-size: 13px; }
.buttons-row {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 80%;
}

.get-more-rounds-btn,
.create-something-btn {
    flex: 1;
    padding: 10px 24px;
    background: #3A4B7C;
    color: #FFFFFF;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-transform: uppercase;
}
.get-more-rounds-btn:hover,
.create-something-btn:hover { opacity: 0.9; }
.get-more-rounds-btn:active,
.create-something-btn:active { transform: translateY(1px); }
.dial { width: 260px; height: 260px; }
.dial-bg {
    fill: none;
    stroke: #3A4B7C;
    stroke-width: 2;
}
.dial-progress {
    fill: none;
    stroke: #B76E00; /* ochre baseline, will transition via JS */
    stroke-linecap: round;
    stroke-width: 2;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 339.292; /* 2 * PI * r (r=54) */
    stroke-dashoffset: 0;
}
.time-text { font-size: 24px; font-weight: 800; fill: #3A4B7C; text-transform: uppercase; }

.start-btn {
    appearance: none;
    border: none;
    padding: 14px 36px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    background: #3A4B7C;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(58, 75, 124, 0.35);
    transition: transform .06s ease, opacity .2s ease;
}
.start-btn:hover { opacity: 0.9; }
.start-btn:active { transform: translateY(1px); }

.controls { display: flex; gap: 12px; align-items: center; }
.login-btn {
    appearance: none;
    border: 1px solid #3A4B7C;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #3A4B7C;
    background: #FFFFFF;
    cursor: pointer;
    transition: transform .06s ease, opacity .2s ease;
}
.login-btn:hover { opacity: 0.9; }
.login-btn:active { transform: translateY(1px); }

.notice {
    margin-top: 14px;
    font-size: 14px;
    color: #3A4B7C;
}

.notice .buy-nothing-link {
    color: #3A4B7C;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.notice .buy-nothing-link:hover {
    opacity: 0.7;
}

/* Exchange Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #FFFFFF;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 16px 20px;
    background: #3A4B7C;
    color: #FFFFFF;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.close {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 14px;
}

/* Single column compact swap layout */
.swap-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.swap-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.swap-title {
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 10px;
    font-size: 11px;
    text-align: center;
}
.swap-container.compact {
    padding: 8px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.swap-row.horizontal {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
}
.asset-field {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 6px;
    min-height: 28px;
    max-height: 28px;
}
.asset-token {
    font-weight: 700;
    color: #3A4B7C;
    font-size: 9px;
    white-space: nowrap;
    min-width: 45px;
    flex-shrink: 0;
}
.asset-field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 12px;
    font-weight: 700;
    background: transparent;
    color: #0f172a;
    padding: 0;
    text-align: center;
}
.asset-balance {
    font-size: 8px;
    color: #64748b;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
    min-width: 45px;
    text-align: right;
}
.swap-arrow-btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #1e40af;
    border-radius: 5px;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    min-width: 28px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.swap-arrow-btn:hover { background: #eef2ff; }
.swap-meta { 
    margin-top: 6px; 
    font-size: 9px; 
    color: #64748b;
    text-align: center;
}
.swap-btn {
    width: 100%;
    padding: 8px 16px;
    background: #3A4B7C;
    color: #FFFFFF;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-top: 10px;
    flex-shrink: 0;
}
.swap-btn:hover {
    opacity: 0.9;
}
.swap-btn:active {
    transform: translateY(1px);
}
.exchange-notice {
    margin-top: 8px;
    padding: 7px;
    border-radius: 6px;
    text-align: center;
    font-size: 11px;
}
.exchange-notice a {
    color: #1e40af;
    text-decoration: underline;
}

.exchange-notice.success {
    background: #d1fae5;
    color: #065f46;
}

.exchange-notice.error {
    background: #fee2e2;
    color: #991b1b;
}

/* How to Play Link */
.how-to-play-link {
    margin-top: 20px;
    text-align: center;
}

.how-to-play-link a {
    color: #3A4B7C;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-transform: lowercase;
    transition: opacity 0.2s ease;
}

.how-to-play-link a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* How to Play Modal Content */
.how-to-play-content {
    padding: 10px;
}

.how-to-play-content h3 {
    margin: 0 0 16px 0;
    color: #3A4B7C;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
}

.how-to-play-content h4 {
    margin: 20px 0 12px 0;
    color: #3A4B7C;
    font-size: 14px;
    font-weight: 700;
    text-transform: lowercase;
}

.how-to-play-list,
.how-to-play-description {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.how-to-play-list li,
.how-to-play-description li {
    margin-bottom: 8px;
    color: #3A4B7C;
    font-size: 13px;
    line-height: 1.6;
}

.how-to-play-list li:before {
    content: "• ";
    font-weight: 700;
    margin-right: 6px;
}

.how-to-play-description li:before {
    content: "→ ";
    font-weight: 700;
    margin-right: 6px;
}

.how-to-play-description .exchange-link {
    color: #3A4B7C;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.how-to-play-description .exchange-link:hover {
    opacity: 0.7;
}

@media (max-width: 860px) {
    .workspace { width: calc(100% - 32px); }
    .swap-grid { grid-template-columns: 1fr; }
    .bottom-panel { flex-direction: column; }
}

