/* Minimal tmat-like styling */
:root{
  --fg:#111;
  --bg:#fafafa;
  --muted:#666;
  --link:#0b57d0;
  --radius:14px;
  --maxw:740px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--fg);font:16px/1.6 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;}
main{max-width:var(--maxw);margin:56px auto;padding:0 20px}
h1{font-size:28px;margin:0 0 8px 0;letter-spacing:-0.01em}
p{margin:0 0 22px 0}
section{margin:28px 0}
.small{color:var(--muted);font-size:14px}
a{color:var(--link);text-decoration:underline;text-underline-offset:2px}
.links a{margin-right:14px}
.figure{margin:22px 0;border-radius:var(--radius);overflow:hidden;border:1px solid #eaeaea;background:#fff;box-shadow:0 1px 0 rgba(0,0,0,.04)}
.figure img{display:block;width:100%;height:auto}
hr{border:0;border-top:1px solid #eaeaea;margin:24px 0}
footer{margin:28px 0;color:var(--muted);font-size:14px}
.clickable{cursor:pointer;display:block;max-width:320px;margin:12px 0}


.hero{
  display:flex;
  align-items:flex-start;
  gap:24px;
}
.hero .left{
  flex:0 0 auto;
}
.hero .left img{
  display:block;
  width:260px;
  max-width:35vw;
  height:auto;
  border-radius:0;
}
.hero .right{
  flex:1 1 auto;
}
@media (max-width:640px){
  .hero{flex-direction:column;gap:12px}
  .hero .left img{width:220px;max-width:60vw}
}


.fixed-bob{
  position:fixed;
  left:20px;
  top:90%;
  transform:translateY(-50%);
  width:180px;
  height:auto;
  cursor:pointer;
  z-index:1000;
  pointer-events:auto;
}
@media(max-width:640px){
  .fixed-bob{width:120px;left:10px;bottom:10px}
}


/* ===== Codeforces-style widget ===== */
.cf-wrap{margin:36px 0}
.cf-panel{
  border:1px solid #d9d9d9;
  border-radius:8px;
  background:#fff;
  overflow:hidden;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.cf-head{
  display:flex;align-items:center;gap:10px;
  padding:10px 14px;
  background:linear-gradient(180deg,#f6f6f7,#ececec);
  border-bottom:1px solid #dcdcdc;
  font-weight:600;
}
.cf-logo{display:flex;gap:6px;align-items:center}
.cf-logo .sq{width:12px;height:12px;border-radius:2px;display:inline-block}
.cf-logo .sq.blue{background:#3b6ab3}
.cf-logo .sq.yellow{background:#f2c500}
.cf-logo .sq.red{background:#e24a3b}

.cf-body{display:flex;gap:16px;padding:14px}
.cf-avatar{
  width:84px;height:84px;border-radius:50%;
  border:2px solid #e6e6e6;flex:0 0 auto;object-fit:cover;background:#fafafa
}
.cf-info{flex:1 1 auto}
.cf-handle{
  margin:0 0 4px 0;font-size:22px;line-height:1.1;
  font-weight:700;letter-spacing:.2px;
}
.cf-handle a{text-decoration:none}
.cf-meta{font-size:14px;color:#666;margin:6px 0 0}
.cf-actions{margin-top:10px}
.cf-btn{
  display:inline-block;padding:6px 10px;border-radius:6px;
  background:#3b6ab3;color:#fff;text-decoration:none;font-size:14px;
}
.cf-btn:hover{opacity:.92}

/* Rating colors (approx CF palette) */
.rating-red a{color:#ff3c3c}
.rating-orange a{color:#ff8c1a}
.rating-purple a{color:#a64dff}
.rating-blue a{color:#3b6ab3}
.rating-cyan a{color:#03a9f4}
.rating-green a{color:#2e9d3c}
.rating-gray a{color:#888}

@media (max-width:640px){
  .cf-body{flex-direction:row;align-items:center}
  .cf-handle{font-size:18px}
  .cf-avatar{width:64px;height:64px}
}
