Capital flight, soaring borrowing costs, tanking currency and stocks and a central bank forced to pump vast amounts of cash into local banks -- that is what Japan may have to contend with if it fails to tackle its snowballing debt.

Not long ago such doomsday scenarios would be dismissed in Tokyo as fantasies of ill-informed foreigners sitting on loss-making bets shorting Japan.

Today this is what is on bureaucrats' minds in Japan's centre of political and economic power.

It's scary when you think what could happen if there's triple-selling of bonds, stocks and the yen. The chance of this happening is bigger than markets think, says a senior official.

Leaning back in a leather sofa in his office, the official appears relaxed, but the way he wastes no time answering questions about a debt meltdown, suggests it is an all too familiar topic.

The official, like many others interviewed by Reuters, declined to be named because of the sensitivity of the subject and his alarm over Japan's $10 trillion-plus debt overhang has yet to be reflected in public debate or action. But these officials would be the ones pulling the levers in the command center if Japan were to be hit by a debt crisis.

The government borrows more than it raises in taxes, and its debt pile amounts to two years' worth of Japan's economic output, the highest debt-to-GDP ratio in the world.

It costs Japan half of the country's tax income just to service its debt. Each year, Japan's debt level increases by more than the combined gross domestic product of Greece and Portugal.

Yet Prime Minister Yoshihiko Noda's plan to double the 5 percent sales tax to 10 percent over the next three years is seen as far too timid to stop debts from piling up.

Furthermore, he has yet to win over many in his own party and half of the public while the opposition threatens to scupper the plan, which it supports in principle, to force snap elections.

Technocrats who might have once dismissed worst-case scenarios are now beginning to take them seriously as doubts grow over whether Japan is ready to act and as Greece's budget meltdown stokes the euro zone's debt crisis.

Conventional wisdom is that Japan is safe as long as it keeps covering about 95 percent of its borrowing needs at home. What emerges from a dozen or so interviews with fund managers and officials versed in monetary and fiscal policy is that a risk of domestic investors going on a strike is what makes them particularly nervous.

ARMAGEDDON SCENARIOS

The fact that bureaucrats openly discuss such disaster scenarios shows their concern that the public, politicians and even some people in financial markets do not take the situation seriously enough, and that the debt blowout will become a self-fulfilling prophecy if necessary steps, such as raising taxes, keep getting pushed back.

But to some economists who have followed Japan for years, the frustration is that the country has yet to solve its underlying problems of slow economic growth and stubborn deflation. As long as those conditions persist, it will be difficult to crawl out from under the debt burden.

If you wind the clock back five or 10 years, they'd have been saying all the same things and probably with a very similar time horizon of three to five years, said Richard Jerram, chief economist at Bank of Singapore.

If you're worried about it, and you think you're three to five years away (from a potential crisis), why not do something about it now by trying to boost growth in the economy? Awareness of the problem never seems to translate into a response.

While officials stress it is too early for a definite contingency plan, there seems to be an agreement that financial institutions will be the hardest hit because of their big government bond holdings, and that the Bank of Japan will play a key role in shoring up the sector.

The most important thing, in the event of a crisis, is perhaps not trying to affect fund flows by buying government bonds in huge amounts, but to make sure Japanese banks aren't forced to sell en masse to meet day-to-day funding, one of the officials familiar with BOJ thinking said. Once it becomes a banking sector problem, it's very hard to contain the damage.

In an event of a surge in yields, the Bank of Japan could flood money markets with cash the way it did after the March 11 earthquake and act as a market-maker for the bond market, matching bids and offers if they fail to meet, officials say.

The finance ministry could also be forced to redeem bonds ahead of maturity to calm investors, says Yoichi Miyazawa, former vice finance minister and upper house lawmaker for the opposition Liberal Democratic Party.

Miyazawa, who led work on the party's crisis plan, says the worst case scenario could involve bank bailouts and Greek-style austerity if debt servicing costs soared, threatening to eat up a big portions of revenues.

The government should show a concrete roadmap for rebuilding public finances, including the kind of reforms adopted by Greece, which involve painful belt-tightening, slashing welfare spending and boosting sales and other tax rates, he said.

Finance Ministry data confirms that banks, rather than the budget, would take the hardest, most direct hit. First, the 2012/13 budget plan is based on 10-year yields of 2 percent, giving the government some cushion considering those bonds are currently yielding less than half of that.

Secondly, its simulations show adding 1 percentage point to borrowing costs would add 1 trillion yen to about 22 trillion in borrowing costs over the course of one year, rather than double them as some commentators warn, because the spike would only affect newly issued and rolled over debt.

TIPPING POINT

What sets Japan apart from Europe's crisis-hit nations is that it borrows almost exclusively at home and with domestic savings of some 1,500 trillion yen ($19 trillion) it can do it paying less than 1 percent for 10-year bonds.

Deflation and the yen's long bull run foster a patriotic home bias among households and institutions, turning private savings into quasi public money, always there and easily accessible.

In addition, the central bank acts as a buyer of last resort for the market, taking up large amounts of government bonds both as part of its annual quota of more than 20 trillion yen and an asset-buying plan launched in 2010.

That explains how a nation with one of the lowest tax burdens in the OECD and a stagnant economy never seemed to have trouble rolling out hefty stimulus packages or subsidizing social security. In fact, the system got so entrenched that bond sales are often reported as budget revenue, not borrowing.

The $10 trillion question is when that money or local investors' patience will run out.

Budget arithmetic and demographics suggest that it will take another decade before Japan's swelling ranks of retirees will begin to run down their vast savings to the point where Tokyo will need to start borrowing more from overseas lenders.

The optimistic view is that until then the government can keep rolling over the snowballing debt with ease.

There's a very strong system in place where all the stakeholders benefit from how things operate now, says one official.

Japanese banks don't have anywhere else to invest, so park their funds in the JGB market. The BOJ supports this by accepting JGBs as collateral. The only thing that could trigger a bond sell-off would be a huge pull-out of deposits from banks, which is hard to imagine.

The government's current medium-term fiscal plan seems based on this optimistic view, assuming a leisurely pace of adjustment and aiming to get close to primary balance, where revenues match spending excluding debt costs, no sooner than in 2021.

Pessimists -- and there seems to be a growing number of those among the bureaucrats -- think there is much less time.

These bureaucrats play a major role in managing Japan. Over decades of virtually single-party rule, Japan developed a system where expertise and formulation of policies would be the domain of elite bureaucrats rather than elected politicians.

The ruling Democratic Party of Japan promised to challenge that system when it swept to power in 2009 alienating many ministry officials. Since Noda took over last September though, he has been repairing relations with bureaucrats and has particularly good, close relations with officials at the finance ministry, which he headed before.

POLITICAL TEST

Officials and fund managers say the first test of nerves could come as soon as next month when the parliament is due to debate the government's proposed sales tax hikes.

Noda calls it a tax and social security reform, but critics say it is a misnomer given that the plan does not prescribe any substantial cuts in pension and health care spending.

Rating agencies, the International Monetary Fund, and many economists also agree that what is on the table will at best slowdown the piling up of the debt.

It is much too little, much too slow, says Koji Sakuma, chief economist at the Institute for International Monetary Affairs think-tank headed by a former top currency official.

Sakuma estimates the sales tax would need to go to 25 percent or more to close the financing gap built up over the past 20 years when Japan failed to respond to rising costs associated with rapid ageing by adjusting taxes and social security premiums.

Even tax hikes on such a scale will fail to reduce the debt burden if Japan remains stuck in deflation and anemic growth, he warns. If we stay in this situation, this amount is never repayable. It's just impossible.

But even a modest rise is seen as a watershed for Japan where raising the sales tax has been a political taboo for years.

Noda's chances look dim because the opposition, which controls the parliament's upper house, wants to leverage that and block the tax plan to force Noda to call an early election.

Yuuki Sakurai, head of Fukoku Capital Management, asset management arm of Fukoku Life Insurance, says the proposal's failure could jolt both foreign and domestic investors. But like many other market players, Sakurai stresses that many big institutions have no choice but to stay invested in Japanese bonds.

A failure to make a decision would greatly ruin sentiment in the JGB market, but investors such as life insurers and pension funds have the obligation to pay in yen, so increasing foreign assets would be a risk for them too.

Dan Farley, chief investment officer at State Street Advisors, a U.S. firm that manages institutional investors' assets, sounds less concerned. His point is that, ironically, Europe's crisis helps Japanese bonds.

Our view is that Japan, much like U.S. Treasuries, continues to be viewed as a safety holding for investors, so given that fact we ultimately always expect that there will be a certain level of demand for those bonds that ultimately helps mitigate any drastic move in interest rates or a sell-off of these bonds.

Farley, speaking in a Tokyo office on the 39th floor of a swanky Tokyo midtown office and shopping complex in the Roppongi district, exudes confidence that contrasts with apocalyptic scenarios spun by some bureaucrats.

If the sales tax hike plan falls apart, that would give foreign investors a chance to start speculative JGB selling, says a government official. Such foreign players got burned in the past but whether they would succeed this time depends largely on how Japanese traders and investors would react. If the Japanese lose faith in JGBs, they would follow suit and trigger a sell-off.

FUKUSHIMA LEGACY

Most officials are not as bearish and believe that while the market may see volatility and some spike in yields from today's record lows, the cards for now remain stacked in JGBs favor.

But they sound genuinely worried that a failure to act on taxes now will make Japan more vulnerable when it reaches the next critical point. That may come if the nation's current account -- the broad measure of its dealings with the world -- swings into deficit.

Hefty surpluses have allowed Japan to accumulate foreign assets exceeding 300 trillion yen, making a nation with the most indebted government also the world's biggest international creditor.

But soaring fuel imports since the Fukushima nuclear crisis drove the trade balance into deficit in 2011 for the first time in three decades and probably brought closer the moment when the current account will also fall into the red.

JPMorgan Securities sees it happening in early 2015, but notes it would take several more years to run down the asset cushion.

Its analysts give only a 5 percent chance that over the next three-to-five years Japan's debt will plunge into crisis, which they define as a surge in 10-year bond yields towards 4 percent. In such a case, domestic financial institutions would dump foreign holdings to cover losses on Japanese government bonds, letting the crisis spill into other countries.

Under a slightly more benign scenario, which the Asahi newspaper reported this month as part of Mitsubishi UFJ Financial banking group's contingency plan, a deficit would come in 2016 and drive 10-year yields to 3.5 percent. The report, which Reuters has been unable to verify, said the bank would respond by selling longer-term bonds and switching to short-term bills.

Fund managers say such scenarios remain hypothetical as long as global investors shun risks and the Japanese lack attractive alternatives to big-scale holdings of yen-denominated government debt.

A resolution of Europe's debt crisis and return of risk appetite combined with a lasting reversal of the yen's upward trend and a return of carry trade using the yen to fund investments in higher-yielding assets could change that.

Farley says the emergence of government debt of new economic powers such as China or Brazil as safe high-grade investment could also allow Japanese investors to diversify away from JGBs, though he expects such a change would be gradual.

Tokyo technocrats worry that the psychological impact of Japan losing its long-cherished status as a top capital exporter could produce an explosive mix if combined with a sense of policy paralysis and better alternatives elsewhere.

The worst-case scenario, or capital flight, would become reality if the Japanese start feeling that Japan will go into steady decline and they will find no reason to keep their assets at home.

($1=78.42 yen)

(Additional reporting by Chikafumi Hodo in TOKYO and Emily Kaiser in SINGAPORE: Graphics by Catherine Trevethan and Stanley White; Editing by Neil Fullick)